From e45eb224909ca75a03ce32f24540fa2fd3470e7b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Nov 2023 19:52:19 +0000 Subject: [PATCH] CodeGen from PR 26703 in Azure/azure-rest-api-specs Merge 6a85a184d7d1df9521947d5e259554b3c9ef1aac into 7b4518dd62258d92e89947ab8b682802d8f116ae --- .../armmachinelearning/CHANGELOG.md | 732 + .../armmachinelearning/autorest.md | 6 +- .../batchdeployments_client.go | 148 +- .../batchdeployments_client_example_test.go | 495 - .../batchendpoints_client.go | 167 +- .../batchendpoints_client_example_test.go | 387 - .../capacityreservationgroups_client.go | 411 + .../armmachinelearning/client_factory.go | 266 +- .../codecontainers_client.go | 89 +- .../codecontainers_client_example_test.go | 192 - .../armmachinelearning/codeversions_client.go | 265 +- .../codeversions_client_example_test.go | 191 - .../componentcontainers_client.go | 89 +- ...componentcontainers_client_example_test.go | 182 - .../componentversions_client.go | 183 +- .../componentversions_client_example_test.go | 200 - .../armmachinelearning/compute_client.go | 559 +- .../compute_client_example_test.go | 1001 - .../armmachinelearning/constants.go | 1660 +- .../datacontainers_client.go | 89 +- .../datacontainers_client_example_test.go | 219 - .../armmachinelearning/datastores_client.go | 108 +- .../datastores_client_example_test.go | 449 - .../armmachinelearning/dataversions_client.go | 183 +- .../dataversions_client_example_test.go | 197 - .../environmentcontainers_client.go | 89 +- ...vironmentcontainers_client_example_test.go | 186 - .../environmentversions_client.go | 183 +- ...environmentversions_client_example_test.go | 271 - .../fake/batchdeployments_server.go | 386 + .../fake/batchendpoints_server.go | 403 + .../fake/capacityreservationgroups_server.go | 338 + .../fake/codecontainers_server.go | 258 + .../fake/codeversions_server.go | 423 + .../fake/componentcontainers_server.go | 264 + .../fake/componentversions_server.go | 372 + .../armmachinelearning/fake/compute_server.go | 816 + .../fake/datacontainers_server.go | 264 + .../fake/datastores_server.go | 368 + .../fake/dataversions_server.go | 378 + .../fake/environmentcontainers_server.go | 264 + .../fake/environmentversions_server.go | 372 + .../fake/features_server.go | 224 + .../fake/featuresetcontainers_server.go | 330 + .../fake/featuresetversions_server.go | 422 + .../featurestoreentitycontainers_server.go | 330 + .../fake/featurestoreentityversions_server.go | 358 + .../fake/inferenceendpoints_server.go | 398 + .../fake/inferencegroups_server.go | 529 + .../fake/inferencepools_server.go | 501 + .../armmachinelearning/fake/internal.go | 112 + .../armmachinelearning/fake/jobs_server.go | 420 + .../fake/labelingjobs_server.go | 450 + .../fake/managednetworkprovisions_server.go | 126 + .../fake/managednetworksettingsrule_server.go | 272 + .../fake/modelcontainers_server.go | 280 + .../fake/modelversions_server.go | 481 + .../fake/onlinedeployments_server.go | 521 + .../fake/onlineendpoints_server.go | 536 + .../fake/operations_server.go | 92 + .../fake/polymorphic_helpers.go | 39 + .../fake/privateendpointconnections_server.go | 242 + .../fake/privatelinkresources_server.go | 108 + .../armmachinelearning/fake/quotas_server.go | 148 + .../fake/registries_server.go | 396 + .../fake/registrycodecontainers_server.go | 284 + .../fake/registrycodeversions_server.go | 373 + .../registrycomponentcontainers_server.go | 284 + .../fake/registrycomponentversions_server.go | 328 + .../fake/registrydatacontainers_server.go | 290 + .../fake/registrydatareferences_server.go | 112 + .../fake/registrydataversions_server.go | 385 + .../registryenvironmentcontainers_server.go | 290 + .../registryenvironmentversions_server.go | 334 + .../fake/registrymodelcontainers_server.go | 290 + .../fake/registrymodelversions_server.go | 467 + .../fake/schedules_server.go | 290 + .../armmachinelearning/fake/server_factory.go | 408 + .../fake/serverlessendpoints_server.go | 490 + .../armmachinelearning/fake/time_rfc3339.go | 86 + .../armmachinelearning/fake/usages_server.go | 108 + .../fake/virtualmachinesizes_server.go | 96 + .../fake/workspaceconnections_server.go | 457 + .../fake/workspacefeatures_server.go | 112 + .../fake/workspaces_server.go | 767 + .../armmachinelearning/features_client.go | 216 + .../featuresetcontainers_client.go | 369 + .../featuresetversions_client.go | 485 + .../featurestoreentitycontainers_client.go | 369 + .../featurestoreentityversions_client.go | 395 + .../machinelearning/armmachinelearning/go.mod | 20 +- .../machinelearning/armmachinelearning/go.sum | 39 +- .../inferenceendpoints_client.go | 472 + .../inferencegroups_client.go | 628 + .../inferencepools_client.go | 592 + .../armmachinelearning/interfaces.go | 471 + .../armmachinelearning/jobs_client.go | 220 +- .../jobs_client_example_test.go | 1500 -- .../armmachinelearning/labelingjobs_client.go | 568 + .../managednetworkprovisions_client.go | 127 + .../managednetworksettingsrule_client.go | 347 + .../modelcontainers_client.go | 89 +- .../modelcontainers_client_example_test.go | 175 - .../armmachinelearning/models.go | 6763 +++-- .../armmachinelearning/models_serde.go | 22019 ++++++++++++---- .../modelversions_client.go | 274 +- .../modelversions_client_example_test.go | 230 - .../onlinedeployments_client.go | 197 +- .../onlinedeployments_client_example_test.go | 1017 - .../onlineendpoints_client.go | 221 +- .../onlineendpoints_client_example_test.go | 449 - .../armmachinelearning/operations_client.go | 15 +- .../operations_client_example_test.go | 70 - .../armmachinelearning/options.go | 1941 ++ .../armmachinelearning/polymorphic_helpers.go | 878 +- .../privateendpointconnections_client.go | 109 +- ...endpointconnections_client_example_test.go | 175 - .../privatelinkresources_client.go | 55 +- ...rivatelinkresources_client_example_test.go | 51 - .../armmachinelearning/quotas_client.go | 54 +- .../quotas_client_example_test.go | 498 - .../armmachinelearning/registries_client.go | 528 + .../registrycodecontainers_client.go | 350 + .../registrycodeversions_client.go | 456 + .../registrycomponentcontainers_client.go | 350 + .../registrycomponentversions_client.go | 380 + .../registrydatacontainers_client.go | 353 + .../registrydatareferences_client.go | 123 + .../registrydataversions_client.go | 462 + .../registryenvironmentcontainers_client.go | 353 + .../registryenvironmentversions_client.go | 383 + .../registrymodelcontainers_client.go | 353 + .../registrymodelversions_client.go | 562 + .../armmachinelearning/response_types.go | 817 +- .../armmachinelearning/schedules_client.go | 114 +- .../schedules_client_example_test.go | 253 - .../serverlessendpoints_client.go | 660 + .../armmachinelearning/time_rfc3339.go | 43 +- .../armmachinelearning/usages_client.go | 30 +- .../usages_client_example_test.go | 431 - .../virtualmachinesizes_client.go | 24 +- ...virtualmachinesizes_client_example_test.go | 396 - .../workspaceconnections_client.go | 353 +- ...orkspaceconnections_client_example_test.go | 152 - .../workspacefeatures_client.go | 30 +- .../workspacefeatures_client_example_test.go | 56 - .../armmachinelearning/workspaces_client.go | 435 +- .../workspaces_client_example_test.go | 683 - 148 files changed, 60122 insertions(+), 18775 deletions(-) delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/capacityreservationgroups_client.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/compute_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchdeployments_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/capacityreservationgroups_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/compute_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/features_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentitycontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentityversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferenceendpoints_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencegroups_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencepools_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/internal.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/labelingjobs_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworkprovisions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworksettingsrule_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlinedeployments_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/polymorphic_helpers.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registries_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodecontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodeversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatacontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatareferences_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydataversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelcontainers_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelversions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/serverlessendpoints_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/time_rfc3339.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspacefeatures_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/features_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/featuresetcontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/featuresetversions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentitycontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentityversions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/inferenceendpoints_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/inferencegroups_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/inferencepools_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/labelingjobs_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/managednetworkprovisions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/managednetworksettingsrule_client.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/operations_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/options.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registries_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrycodecontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrycodeversions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentcontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentversions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrydatacontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrydatareferences_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrydataversions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentcontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentversions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelcontainers_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelversions_client.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/serverlessendpoints_client.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/usages_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client_example_test.go delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client_example_test.go diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md b/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md index 3afb25d50b12..9acdb4938c20 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md @@ -1,5 +1,737 @@ # Release History +## 4.0.0-beta.1 (2023-11-14) +### Breaking Changes + +- Function `*WorkspaceConnectionsClient.Create` parameter(s) have been changed from `(context.Context, string, string, string, WorkspaceConnectionPropertiesV2BasicResource, *WorkspaceConnectionsClientCreateOptions)` to `(context.Context, string, string, string, *WorkspaceConnectionsClientCreateOptions)` +- Type of `ComputeStartStopSchedule.Cron` has been changed from `*CronTrigger` to `*Cron` +- Type of `ComputeStartStopSchedule.Recurrence` has been changed from `*RecurrenceTrigger` to `*Recurrence` +- Type of `ComputeStartStopSchedule.TriggerType` has been changed from `*TriggerType` to `*ComputeTriggerType` +- Type of `EncryptionProperty.KeyVaultProperties` has been changed from `*EncryptionKeyVaultProperties` to `*KeyVaultProperties` +- Type of `ExternalFQDNResponse.Value` has been changed from `[]*FQDNEndpoints` to `[]*FQDNEndpointsPropertyBag` +- Type of `PrivateEndpointConnectionProperties.PrivateEndpoint` has been changed from `*PrivateEndpoint` to `*WorkspacePrivateEndpointResource` +- Type of `PrivateLinkServiceConnectionState.Status` has been changed from `*PrivateEndpointServiceConnectionStatus` to `*EndpointServiceConnectionStatus` +- Type of `SharedPrivateLinkResourceProperty.Status` has been changed from `*PrivateEndpointServiceConnectionStatus` to `*EndpointServiceConnectionStatus` +- Type of `WorkspaceProperties.PublicNetworkAccess` has been changed from `*PublicNetworkAccess` to `*PublicNetworkAccessType` +- Type of `WorkspacePropertiesUpdateParameters.PublicNetworkAccess` has been changed from `*PublicNetworkAccess` to `*PublicNetworkAccessType` +- Enum `PrivateEndpointServiceConnectionStatus` has been removed +- Enum `PublicNetworkAccess` has been removed +- Enum `ValueFormat` has been removed +- Function `timeRFC3339.MarshalText` has been removed +- Function `*timeRFC3339.Parse` has been removed +- Function `*timeRFC3339.UnmarshalText` has been removed +- Operation `*PrivateLinkResourcesClient.List` has supported pagination, use `*PrivateLinkResourcesClient.NewListPager` instead. +- Struct `AmlOperation` has been removed +- Struct `AmlOperationDisplay` has been removed +- Struct `AmlOperationListResult` has been removed +- Struct `EncryptionKeyVaultProperties` has been removed +- Struct `FQDNEndpointsProperties` has been removed +- Field `Properties` of struct `FQDNEndpoints` has been removed +- Field `UserStorageResourceID` of struct `ListWorkspaceKeysResult` has been removed +- Field `Value`, `ValueFormat` of struct `ManagedIdentityAuthTypeWorkspaceConnectionProperties` has been removed +- Field `Value`, `ValueFormat` of struct `NoneAuthTypeWorkspaceConnectionProperties` has been removed +- Field `AmlOperationListResult` of struct `OperationsClientListResponse` has been removed +- Field `Value`, `ValueFormat` of struct `PATAuthTypeWorkspaceConnectionProperties` has been removed +- Field `SubnetArmID` of struct `PrivateEndpoint` has been removed +- Field `Value`, `ValueFormat` of struct `SASAuthTypeWorkspaceConnectionProperties` has been removed +- Field `Value`, `ValueFormat` of struct `UsernamePasswordAuthTypeWorkspaceConnectionProperties` has been removed +- Field `Value`, `ValueFormat` of struct `WorkspaceConnectionPropertiesV2` has been removed +- Field `Parameters` of struct `WorkspacesClientBeginDiagnoseOptions` has been removed + +### Features Added + +- New value `ComputeInstanceStateResizing` added to enum type `ComputeInstanceState` +- New value `ConnectionAuthTypeAPIKey`, `ConnectionAuthTypeAccessKey`, `ConnectionAuthTypeCustomKeys`, `ConnectionAuthTypeServicePrincipal` added to enum type `ConnectionAuthType` +- New value `ConnectionCategoryADLSGen2`, `ConnectionCategoryAPIKey`, `ConnectionCategoryAzureMySQLDb`, `ConnectionCategoryAzureOpenAI`, `ConnectionCategoryAzurePostgresDb`, `ConnectionCategoryAzureSQLDb`, `ConnectionCategoryAzureSynapseAnalytics`, `ConnectionCategoryCognitiveSearch`, `ConnectionCategoryCognitiveService`, `ConnectionCategoryCustomKeys`, `ConnectionCategoryRedis`, `ConnectionCategoryS3`, `ConnectionCategorySnowflake` added to enum type `ConnectionCategory` +- New value `ContainerTypeModelDataCollector` added to enum type `ContainerType` +- New value `CredentialsTypeKerberosKeytab`, `CredentialsTypeKerberosPassword` added to enum type `CredentialsType` +- New value `DatastoreTypeHdfs`, `DatastoreTypeOneLake` added to enum type `DatastoreType` +- New value `DistributionTypeRay` added to enum type `DistributionType` +- New value `JobStatusScheduled` added to enum type `JobStatus` +- New value `JobTypeLabeling`, `JobTypeSpark` added to enum type `JobType` +- New value `OperationNameResize` added to enum type `OperationName` +- New value `OperationStatusResizeFailed` added to enum type `OperationStatus` +- New value `OutputDeliveryModeDirect` added to enum type `OutputDeliveryMode` +- New value `ScheduleActionTypeCreateMonitor`, `ScheduleActionTypeImportData` added to enum type `ScheduleActionType` +- New value `SecretsTypeKerberosKeytab`, `SecretsTypeKerberosPassword` added to enum type `SecretsType` +- New enum type `ActionType` with values `ActionTypeInternal` +- New enum type `AssetProvisioningState` with values `AssetProvisioningStateCanceled`, `AssetProvisioningStateCreating`, `AssetProvisioningStateDeleting`, `AssetProvisioningStateFailed`, `AssetProvisioningStateSucceeded`, `AssetProvisioningStateUpdating` +- New enum type `AuthMode` with values `AuthModeAAD` +- New enum type `AutoDeleteCondition` with values `AutoDeleteConditionCreatedGreaterThan`, `AutoDeleteConditionLastAccessedGreaterThan` +- New enum type `BaseEnvironmentSourceType` with values `BaseEnvironmentSourceTypeEnvironmentAsset` +- New enum type `BatchDeploymentConfigurationType` with values `BatchDeploymentConfigurationTypeModel`, `BatchDeploymentConfigurationTypePipelineComponent` +- New enum type `CategoricalDataDriftMetric` with values `CategoricalDataDriftMetricJensenShannonDistance`, `CategoricalDataDriftMetricPearsonsChiSquaredTest`, `CategoricalDataDriftMetricPopulationStabilityIndex` +- New enum type `CategoricalDataQualityMetric` with values `CategoricalDataQualityMetricDataTypeErrorRate`, `CategoricalDataQualityMetricNullValueRate`, `CategoricalDataQualityMetricOutOfBoundsRate` +- New enum type `CategoricalPredictionDriftMetric` with values `CategoricalPredictionDriftMetricJensenShannonDistance`, `CategoricalPredictionDriftMetricPearsonsChiSquaredTest`, `CategoricalPredictionDriftMetricPopulationStabilityIndex` +- New enum type `ClassificationModelPerformanceMetric` with values `ClassificationModelPerformanceMetricAccuracy`, `ClassificationModelPerformanceMetricPrecision`, `ClassificationModelPerformanceMetricRecall` +- New enum type `ComputeRecurrenceFrequency` with values `ComputeRecurrenceFrequencyDay`, `ComputeRecurrenceFrequencyHour`, `ComputeRecurrenceFrequencyMinute`, `ComputeRecurrenceFrequencyMonth`, `ComputeRecurrenceFrequencyWeek` +- New enum type `ComputeTriggerType` with values `ComputeTriggerTypeCron`, `ComputeTriggerTypeRecurrence` +- New enum type `ComputeWeekDay` with values `ComputeWeekDayFriday`, `ComputeWeekDayMonday`, `ComputeWeekDaySaturday`, `ComputeWeekDaySunday`, `ComputeWeekDayThursday`, `ComputeWeekDayTuesday`, `ComputeWeekDayWednesday` +- New enum type `DataAvailabilityStatus` with values `DataAvailabilityStatusComplete`, `DataAvailabilityStatusIncomplete`, `DataAvailabilityStatusNone`, `DataAvailabilityStatusPending` +- New enum type `DataCollectionMode` with values `DataCollectionModeDisabled`, `DataCollectionModeEnabled` +- New enum type `DataImportSourceType` with values `DataImportSourceTypeDatabase`, `DataImportSourceTypeFileSystem` +- New enum type `DataReferenceCredentialType` with values `DataReferenceCredentialTypeDockerCredentials`, `DataReferenceCredentialTypeManagedIdentity`, `DataReferenceCredentialTypeNoCredentials`, `DataReferenceCredentialTypeSAS` +- New enum type `EmailNotificationEnableType` with values `EmailNotificationEnableTypeJobCancelled`, `EmailNotificationEnableTypeJobCompleted`, `EmailNotificationEnableTypeJobFailed` +- New enum type `EndpointServiceConnectionStatus` with values `EndpointServiceConnectionStatusApproved`, `EndpointServiceConnectionStatusDisconnected`, `EndpointServiceConnectionStatusPending`, `EndpointServiceConnectionStatusRejected`, `EndpointServiceConnectionStatusTimeout` +- New enum type `EnvironmentVariableType` with values `EnvironmentVariableTypeLocal` +- New enum type `ExportFormatType` with values `ExportFormatTypeCSV`, `ExportFormatTypeCoco`, `ExportFormatTypeDataset` +- New enum type `FeatureAttributionMetric` with values `FeatureAttributionMetricNormalizedDiscountedCumulativeGain` +- New enum type `FeatureDataType` with values `FeatureDataTypeBinary`, `FeatureDataTypeBoolean`, `FeatureDataTypeDatetime`, `FeatureDataTypeDouble`, `FeatureDataTypeFloat`, `FeatureDataTypeInteger`, `FeatureDataTypeLong`, `FeatureDataTypeString` +- New enum type `FeatureImportanceMode` with values `FeatureImportanceModeDisabled`, `FeatureImportanceModeEnabled` +- New enum type `GenerationSafetyQualityMetric` with values `GenerationSafetyQualityMetricAcceptableCoherenceScorePerInstance`, `GenerationSafetyQualityMetricAcceptableFluencyScorePerInstance`, `GenerationSafetyQualityMetricAcceptableGroundednessScorePerInstance`, `GenerationSafetyQualityMetricAcceptableRelevanceScorePerInstance`, `GenerationSafetyQualityMetricAcceptableSimilarityScorePerInstance`, `GenerationSafetyQualityMetricAggregatedCoherencePassRate`, `GenerationSafetyQualityMetricAggregatedFluencyPassRate`, `GenerationSafetyQualityMetricAggregatedGroundednessPassRate`, `GenerationSafetyQualityMetricAggregatedRelevancePassRate`, `GenerationSafetyQualityMetricAggregatedSimilarityPassRate` +- New enum type `GenerationTokenUsageMetric` with values `GenerationTokenUsageMetricTotalTokenCount`, `GenerationTokenUsageMetricTotalTokenCountPerGroup` +- New enum type `ImageAnnotationType` with values `ImageAnnotationTypeBoundingBox`, `ImageAnnotationTypeClassification`, `ImageAnnotationTypeInstanceSegmentation` +- New enum type `ImageType` with values `ImageTypeAzureml`, `ImageTypeDocker` +- New enum type `IncrementalDataRefresh` with values `IncrementalDataRefreshDisabled`, `IncrementalDataRefreshEnabled` +- New enum type `InferencingServerType` with values `InferencingServerTypeAzureMLBatch`, `InferencingServerTypeAzureMLOnline`, `InferencingServerTypeCustom`, `InferencingServerTypeTriton` +- New enum type `InputPathType` with values `InputPathTypePathID`, `InputPathTypePathVersion`, `InputPathTypeURL` +- New enum type `IsolationMode` with values `IsolationModeAllowInternetOutbound`, `IsolationModeAllowOnlyApprovedOutbound`, `IsolationModeDisabled` +- New enum type `JobProvisioningState` with values `JobProvisioningStateCanceled`, `JobProvisioningStateFailed`, `JobProvisioningStateInProgress`, `JobProvisioningStateSucceeded` +- New enum type `JobTier` with values `JobTierBasic`, `JobTierNull`, `JobTierPremium`, `JobTierSpot`, `JobTierStandard` +- New enum type `LogTrainingMetrics` with values `LogTrainingMetricsDisable`, `LogTrainingMetricsEnable` +- New enum type `LogValidationLoss` with values `LogValidationLossDisable`, `LogValidationLossEnable` +- New enum type `MLAssistConfigurationType` with values `MLAssistConfigurationTypeDisabled`, `MLAssistConfigurationTypeEnabled` +- New enum type `MLFlowAutologgerState` with values `MLFlowAutologgerStateDisabled`, `MLFlowAutologgerStateEnabled` +- New enum type `ManagedNetworkStatus` with values `ManagedNetworkStatusActive`, `ManagedNetworkStatusInactive` +- New enum type `MaterializationStoreType` with values `MaterializationStoreTypeNone`, `MaterializationStoreTypeOffline`, `MaterializationStoreTypeOnline`, `MaterializationStoreTypeOnlineAndOffline` +- New enum type `MediaType` with values `MediaTypeImage`, `MediaTypeText` +- New enum type `MlflowAutologger` with values `MlflowAutologgerDisabled`, `MlflowAutologgerEnabled` +- New enum type `ModelTaskType` with values `ModelTaskTypeClassification`, `ModelTaskTypeQuestionAnswering`, `ModelTaskTypeRegression` +- New enum type `MonitorComputeIdentityType` with values `MonitorComputeIdentityTypeAmlToken`, `MonitorComputeIdentityTypeManagedIdentity` +- New enum type `MonitorComputeType` with values `MonitorComputeTypeServerlessSpark` +- New enum type `MonitoringFeatureDataType` with values `MonitoringFeatureDataTypeCategorical`, `MonitoringFeatureDataTypeNumerical` +- New enum type `MonitoringFeatureFilterType` with values `MonitoringFeatureFilterTypeAllFeatures`, `MonitoringFeatureFilterTypeFeatureSubset`, `MonitoringFeatureFilterTypeTopNByAttribution` +- New enum type `MonitoringInputDataType` with values `MonitoringInputDataTypeFixed`, `MonitoringInputDataTypeRolling`, `MonitoringInputDataTypeStatic` +- New enum type `MonitoringModelType` with values `MonitoringModelTypeClassification`, `MonitoringModelTypeRegression` +- New enum type `MonitoringNotificationType` with values `MonitoringNotificationTypeAmlNotification`, `MonitoringNotificationTypeAzureMonitor` +- New enum type `MonitoringSignalType` with values `MonitoringSignalTypeCustom`, `MonitoringSignalTypeDataDrift`, `MonitoringSignalTypeDataQuality`, `MonitoringSignalTypeFeatureAttributionDrift`, `MonitoringSignalTypeGenerationSafetyQuality`, `MonitoringSignalTypeGenerationTokenStatistics`, `MonitoringSignalTypeModelPerformance`, `MonitoringSignalTypePredictionDrift` +- New enum type `MultiSelect` with values `MultiSelectDisabled`, `MultiSelectEnabled` +- New enum type `NlpLearningRateScheduler` with values `NlpLearningRateSchedulerConstant`, `NlpLearningRateSchedulerConstantWithWarmup`, `NlpLearningRateSchedulerCosine`, `NlpLearningRateSchedulerCosineWithRestarts`, `NlpLearningRateSchedulerLinear`, `NlpLearningRateSchedulerNone`, `NlpLearningRateSchedulerPolynomial` +- New enum type `NodesValueType` with values `NodesValueTypeAll`, `NodesValueTypeCustom` +- New enum type `NumericalDataDriftMetric` with values `NumericalDataDriftMetricJensenShannonDistance`, `NumericalDataDriftMetricNormalizedWassersteinDistance`, `NumericalDataDriftMetricPopulationStabilityIndex`, `NumericalDataDriftMetricTwoSampleKolmogorovSmirnovTest` +- New enum type `NumericalDataQualityMetric` with values `NumericalDataQualityMetricDataTypeErrorRate`, `NumericalDataQualityMetricNullValueRate`, `NumericalDataQualityMetricOutOfBoundsRate` +- New enum type `NumericalPredictionDriftMetric` with values `NumericalPredictionDriftMetricJensenShannonDistance`, `NumericalPredictionDriftMetricNormalizedWassersteinDistance`, `NumericalPredictionDriftMetricPopulationStabilityIndex`, `NumericalPredictionDriftMetricTwoSampleKolmogorovSmirnovTest` +- New enum type `OneLakeArtifactType` with values `OneLakeArtifactTypeLakeHouse` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `PackageBuildState` with values `PackageBuildStateFailed`, `PackageBuildStateNotStarted`, `PackageBuildStateRunning`, `PackageBuildStateSucceeded` +- New enum type `PackageInputDeliveryMode` with values `PackageInputDeliveryModeCopy`, `PackageInputDeliveryModeDownload` +- New enum type `PackageInputType` with values `PackageInputTypeURIFile`, `PackageInputTypeURIFolder` +- New enum type `PatchStatus` with values `PatchStatusCompletedWithWarnings`, `PatchStatusFailed`, `PatchStatusInProgress`, `PatchStatusSucceeded`, `PatchStatusUnknown` +- New enum type `PendingUploadCredentialType` with values `PendingUploadCredentialTypeSAS` +- New enum type `PendingUploadType` with values `PendingUploadTypeNone`, `PendingUploadTypeTemporaryBlobReference` +- New enum type `PoolProvisioningState` with values `PoolProvisioningStateCanceled`, `PoolProvisioningStateCreating`, `PoolProvisioningStateDeleting`, `PoolProvisioningStateFailed`, `PoolProvisioningStateSucceeded`, `PoolProvisioningStateUpdating` +- New enum type `ProtectionLevel` with values `ProtectionLevelAll`, `ProtectionLevelNone` +- New enum type `Protocol` with values `ProtocolHTTP`, `ProtocolTCP`, `ProtocolUDP` +- New enum type `RegressionModelPerformanceMetric` with values `RegressionModelPerformanceMetricMeanAbsoluteError`, `RegressionModelPerformanceMetricMeanSquaredError`, `RegressionModelPerformanceMetricRootMeanSquaredError` +- New enum type `RollingRateType` with values `RollingRateTypeDay`, `RollingRateTypeHour`, `RollingRateTypeMinute`, `RollingRateTypeMonth`, `RollingRateTypeYear` +- New enum type `RuleAction` with values `RuleActionAllow`, `RuleActionDeny` +- New enum type `RuleCategory` with values `RuleCategoryRecommended`, `RuleCategoryRequired`, `RuleCategoryUserDefined` +- New enum type `RuleStatus` with values `RuleStatusActive`, `RuleStatusInactive` +- New enum type `RuleType` with values `RuleTypeFQDN`, `RuleTypePrivateEndpoint`, `RuleTypeServiceTag` +- New enum type `ServerlessInferenceEndpointAuthMode` with values `ServerlessInferenceEndpointAuthModeAAD`, `ServerlessInferenceEndpointAuthModeKey` +- New enum type `SparkJobEntryType` with values `SparkJobEntryTypeSparkJobPythonEntry`, `SparkJobEntryTypeSparkJobScalaEntry` +- New enum type `StatusMessageLevel` with values `StatusMessageLevelError`, `StatusMessageLevelInformation`, `StatusMessageLevelWarning` +- New enum type `TextAnnotationType` with values `TextAnnotationTypeClassification`, `TextAnnotationTypeNamedEntityRecognition` +- New enum type `TrainingMode` with values `TrainingModeAuto`, `TrainingModeDistributed`, `TrainingModeNonDistributed` +- New enum type `VolumeDefinitionType` with values `VolumeDefinitionTypeBind`, `VolumeDefinitionTypeNpipe`, `VolumeDefinitionTypeTmpfs`, `VolumeDefinitionTypeVolume` +- New enum type `WebhookType` with values `WebhookTypeAzureDevOps` +- New function `*APIKeyAuthWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*AccessKeyAuthTypeWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*AllFeatures.GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase` +- New function `*AllNodes.GetNodes() *Nodes` +- New function `*AmlTokenComputeIdentity.GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase` +- New function `*AnonymousAccessCredential.GetDataReferenceCredential() *DataReferenceCredential` +- New function `*AzureDevOpsWebhook.GetWebhook() *Webhook` +- New function `*AzureMLBatchInferencingServer.GetInferencingServer() *InferencingServer` +- New function `*AzureMLOnlineInferencingServer.GetInferencingServer() *InferencingServer` +- New function `*BaseEnvironmentID.GetBaseEnvironmentSource() *BaseEnvironmentSource` +- New function `*BaseEnvironmentSource.GetBaseEnvironmentSource() *BaseEnvironmentSource` +- New function `*BatchDeploymentConfiguration.GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration` +- New function `*BatchPipelineComponentDeploymentConfiguration.GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration` +- New function `*CSVExportSummary.GetExportSummary() *ExportSummary` +- New function `NewCapacityReservationGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CapacityReservationGroupsClient, error)` +- New function `*CapacityReservationGroupsClient.CreateOrUpdate(context.Context, string, string, CapacityReservationGroup, *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error)` +- New function `*CapacityReservationGroupsClient.Delete(context.Context, string, string, *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error)` +- New function `*CapacityReservationGroupsClient.Get(context.Context, string, string, *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error)` +- New function `*CapacityReservationGroupsClient.NewListBySubscriptionPager(*CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse]` +- New function `*CapacityReservationGroupsClient.NewListPager(string, *CapacityReservationGroupsClientListOptions) *runtime.Pager[CapacityReservationGroupsClientListResponse]` +- New function `*CapacityReservationGroupsClient.Update(context.Context, string, string, PartialMinimalTrackedResourceWithSKUAndIdentity, *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error)` +- New function `*CategoricalDataDriftMetricThreshold.GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase` +- New function `*CategoricalDataQualityMetricThreshold.GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase` +- New function `*CategoricalPredictionDriftMetricThreshold.GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase` +- New function `*ClassificationModelPerformanceMetricThreshold.GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase` +- New function `*ClientFactory.NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient` +- New function `*ClientFactory.NewFeaturesClient() *FeaturesClient` +- New function `*ClientFactory.NewFeaturesetContainersClient() *FeaturesetContainersClient` +- New function `*ClientFactory.NewFeaturesetVersionsClient() *FeaturesetVersionsClient` +- New function `*ClientFactory.NewFeaturestoreEntityContainersClient() *FeaturestoreEntityContainersClient` +- New function `*ClientFactory.NewFeaturestoreEntityVersionsClient() *FeaturestoreEntityVersionsClient` +- New function `*ClientFactory.NewInferenceEndpointsClient() *InferenceEndpointsClient` +- New function `*ClientFactory.NewInferenceGroupsClient() *InferenceGroupsClient` +- New function `*ClientFactory.NewInferencePoolsClient() *InferencePoolsClient` +- New function `*ClientFactory.NewLabelingJobsClient() *LabelingJobsClient` +- New function `*ClientFactory.NewManagedNetworkProvisionsClient() *ManagedNetworkProvisionsClient` +- New function `*ClientFactory.NewManagedNetworkSettingsRuleClient() *ManagedNetworkSettingsRuleClient` +- New function `*ClientFactory.NewRegistriesClient() *RegistriesClient` +- New function `*ClientFactory.NewRegistryCodeContainersClient() *RegistryCodeContainersClient` +- New function `*ClientFactory.NewRegistryCodeVersionsClient() *RegistryCodeVersionsClient` +- New function `*ClientFactory.NewRegistryComponentContainersClient() *RegistryComponentContainersClient` +- New function `*ClientFactory.NewRegistryComponentVersionsClient() *RegistryComponentVersionsClient` +- New function `*ClientFactory.NewRegistryDataContainersClient() *RegistryDataContainersClient` +- New function `*ClientFactory.NewRegistryDataReferencesClient() *RegistryDataReferencesClient` +- New function `*ClientFactory.NewRegistryDataVersionsClient() *RegistryDataVersionsClient` +- New function `*ClientFactory.NewRegistryEnvironmentContainersClient() *RegistryEnvironmentContainersClient` +- New function `*ClientFactory.NewRegistryEnvironmentVersionsClient() *RegistryEnvironmentVersionsClient` +- New function `*ClientFactory.NewRegistryModelContainersClient() *RegistryModelContainersClient` +- New function `*ClientFactory.NewRegistryModelVersionsClient() *RegistryModelVersionsClient` +- New function `*ClientFactory.NewServerlessEndpointsClient() *ServerlessEndpointsClient` +- New function `*CocoExportSummary.GetExportSummary() *ExportSummary` +- New function `*CodeVersionsClient.CreateOrGetStartPendingUpload(context.Context, string, string, string, string, PendingUploadRequestDto, *CodeVersionsClientCreateOrGetStartPendingUploadOptions) (CodeVersionsClientCreateOrGetStartPendingUploadResponse, error)` +- New function `*CodeVersionsClient.BeginPublish(context.Context, string, string, string, string, DestinationAsset, *CodeVersionsClientBeginPublishOptions) (*runtime.Poller[CodeVersionsClientPublishResponse], error)` +- New function `*ComponentVersionsClient.BeginPublish(context.Context, string, string, string, string, DestinationAsset, *ComponentVersionsClientBeginPublishOptions) (*runtime.Poller[ComponentVersionsClientPublishResponse], error)` +- New function `*ComputeClient.GetAllowedResizeSizes(context.Context, string, string, string, *ComputeClientGetAllowedResizeSizesOptions) (ComputeClientGetAllowedResizeSizesResponse, error)` +- New function `*ComputeClient.BeginResize(context.Context, string, string, string, ResizeSchema, *ComputeClientBeginResizeOptions) (*runtime.Poller[ComputeClientResizeResponse], error)` +- New function `*ComputeClient.UpdateCustomServices(context.Context, string, string, string, []*CustomService, *ComputeClientUpdateCustomServicesOptions) (ComputeClientUpdateCustomServicesResponse, error)` +- New function `*ComputeClient.UpdateIdleShutdownSetting(context.Context, string, string, string, IdleShutdownSetting, *ComputeClientUpdateIdleShutdownSettingOptions) (ComputeClientUpdateIdleShutdownSettingResponse, error)` +- New function `*CreateMonitorAction.GetScheduleActionBase() *ScheduleActionBase` +- New function `*CustomInferencingServer.GetInferencingServer() *InferencingServer` +- New function `*CustomKeysWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*CustomMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*DataDriftMetricThresholdBase.GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase` +- New function `*DataDriftMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*DataImport.GetDataVersionBaseProperties() *DataVersionBaseProperties` +- New function `*DataImportSource.GetDataImportSource() *DataImportSource` +- New function `*DataQualityMetricThresholdBase.GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase` +- New function `*DataQualityMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*DataReferenceCredential.GetDataReferenceCredential() *DataReferenceCredential` +- New function `*DataVersionsClient.BeginPublish(context.Context, string, string, string, string, DestinationAsset, *DataVersionsClientBeginPublishOptions) (*runtime.Poller[DataVersionsClientPublishResponse], error)` +- New function `*DatabaseSource.GetDataImportSource() *DataImportSource` +- New function `*DatasetExportSummary.GetExportSummary() *ExportSummary` +- New function `*DockerCredential.GetDataReferenceCredential() *DataReferenceCredential` +- New function `*EnvironmentVersionsClient.BeginPublish(context.Context, string, string, string, string, DestinationAsset, *EnvironmentVersionsClientBeginPublishOptions) (*runtime.Poller[EnvironmentVersionsClientPublishResponse], error)` +- New function `*ExportSummary.GetExportSummary() *ExportSummary` +- New function `*FeatureAttributionDriftMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*FeatureSubset.GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase` +- New function `NewFeaturesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FeaturesClient, error)` +- New function `*FeaturesClient.Get(context.Context, string, string, string, string, string, *FeaturesClientGetOptions) (FeaturesClientGetResponse, error)` +- New function `*FeaturesClient.NewListPager(string, string, string, string, *FeaturesClientListOptions) *runtime.Pager[FeaturesClientListResponse]` +- New function `NewFeaturesetContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FeaturesetContainersClient, error)` +- New function `*FeaturesetContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, FeaturesetContainer, *FeaturesetContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturesetContainersClientCreateOrUpdateResponse], error)` +- New function `*FeaturesetContainersClient.BeginDelete(context.Context, string, string, string, *FeaturesetContainersClientBeginDeleteOptions) (*runtime.Poller[FeaturesetContainersClientDeleteResponse], error)` +- New function `*FeaturesetContainersClient.GetEntity(context.Context, string, string, string, *FeaturesetContainersClientGetEntityOptions) (FeaturesetContainersClientGetEntityResponse, error)` +- New function `*FeaturesetContainersClient.NewListPager(string, string, *FeaturesetContainersClientListOptions) *runtime.Pager[FeaturesetContainersClientListResponse]` +- New function `NewFeaturesetVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FeaturesetVersionsClient, error)` +- New function `*FeaturesetVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, FeaturesetVersion, *FeaturesetVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturesetVersionsClientCreateOrUpdateResponse], error)` +- New function `*FeaturesetVersionsClient.BeginDelete(context.Context, string, string, string, string, *FeaturesetVersionsClientBeginDeleteOptions) (*runtime.Poller[FeaturesetVersionsClientDeleteResponse], error)` +- New function `*FeaturesetVersionsClient.Get(context.Context, string, string, string, string, *FeaturesetVersionsClientGetOptions) (FeaturesetVersionsClientGetResponse, error)` +- New function `*FeaturesetVersionsClient.NewListPager(string, string, string, *FeaturesetVersionsClientListOptions) *runtime.Pager[FeaturesetVersionsClientListResponse]` +- New function `*FeaturesetVersionsClient.BeginBackfill(context.Context, string, string, string, string, FeaturesetVersionBackfillRequest, *FeaturesetVersionsClientBeginBackfillOptions) (*runtime.Poller[FeaturesetVersionsClientBackfillResponse], error)` +- New function `NewFeaturestoreEntityContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FeaturestoreEntityContainersClient, error)` +- New function `*FeaturestoreEntityContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, FeaturestoreEntityContainer, *FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturestoreEntityContainersClientCreateOrUpdateResponse], error)` +- New function `*FeaturestoreEntityContainersClient.BeginDelete(context.Context, string, string, string, *FeaturestoreEntityContainersClientBeginDeleteOptions) (*runtime.Poller[FeaturestoreEntityContainersClientDeleteResponse], error)` +- New function `*FeaturestoreEntityContainersClient.GetEntity(context.Context, string, string, string, *FeaturestoreEntityContainersClientGetEntityOptions) (FeaturestoreEntityContainersClientGetEntityResponse, error)` +- New function `*FeaturestoreEntityContainersClient.NewListPager(string, string, *FeaturestoreEntityContainersClientListOptions) *runtime.Pager[FeaturestoreEntityContainersClientListResponse]` +- New function `NewFeaturestoreEntityVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FeaturestoreEntityVersionsClient, error)` +- New function `*FeaturestoreEntityVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, FeaturestoreEntityVersion, *FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturestoreEntityVersionsClientCreateOrUpdateResponse], error)` +- New function `*FeaturestoreEntityVersionsClient.BeginDelete(context.Context, string, string, string, string, *FeaturestoreEntityVersionsClientBeginDeleteOptions) (*runtime.Poller[FeaturestoreEntityVersionsClientDeleteResponse], error)` +- New function `*FeaturestoreEntityVersionsClient.Get(context.Context, string, string, string, string, *FeaturestoreEntityVersionsClientGetOptions) (FeaturestoreEntityVersionsClientGetResponse, error)` +- New function `*FeaturestoreEntityVersionsClient.NewListPager(string, string, string, *FeaturestoreEntityVersionsClientListOptions) *runtime.Pager[FeaturestoreEntityVersionsClientListResponse]` +- New function `*FileSystemSource.GetDataImportSource() *DataImportSource` +- New function `*FixedInputData.GetMonitoringInputDataBase() *MonitoringInputDataBase` +- New function `*FqdnOutboundRule.GetOutboundRule() *OutboundRule` +- New function `*GenerationSafetyQualityMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*GenerationTokenUsageSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*HdfsDatastore.GetDatastoreProperties() *DatastoreProperties` +- New function `*ImportDataAction.GetScheduleActionBase() *ScheduleActionBase` +- New function `NewInferenceEndpointsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*InferenceEndpointsClient, error)` +- New function `*InferenceEndpointsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, InferenceEndpoint, *InferenceEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InferenceEndpointsClientCreateOrUpdateResponse], error)` +- New function `*InferenceEndpointsClient.BeginDelete(context.Context, string, string, string, string, *InferenceEndpointsClientBeginDeleteOptions) (*runtime.Poller[InferenceEndpointsClientDeleteResponse], error)` +- New function `*InferenceEndpointsClient.Get(context.Context, string, string, string, string, *InferenceEndpointsClientGetOptions) (InferenceEndpointsClientGetResponse, error)` +- New function `*InferenceEndpointsClient.NewListPager(string, string, string, *InferenceEndpointsClientListOptions) *runtime.Pager[InferenceEndpointsClientListResponse]` +- New function `*InferenceEndpointsClient.BeginUpdate(context.Context, string, string, string, string, any, *InferenceEndpointsClientBeginUpdateOptions) (*runtime.Poller[InferenceEndpointsClientUpdateResponse], error)` +- New function `NewInferenceGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*InferenceGroupsClient, error)` +- New function `*InferenceGroupsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, InferenceGroup, *InferenceGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InferenceGroupsClientCreateOrUpdateResponse], error)` +- New function `*InferenceGroupsClient.BeginDelete(context.Context, string, string, string, string, *InferenceGroupsClientBeginDeleteOptions) (*runtime.Poller[InferenceGroupsClientDeleteResponse], error)` +- New function `*InferenceGroupsClient.Get(context.Context, string, string, string, string, *InferenceGroupsClientGetOptions) (InferenceGroupsClientGetResponse, error)` +- New function `*InferenceGroupsClient.GetStatus(context.Context, string, string, string, string, *InferenceGroupsClientGetStatusOptions) (InferenceGroupsClientGetStatusResponse, error)` +- New function `*InferenceGroupsClient.NewListPager(string, string, string, *InferenceGroupsClientListOptions) *runtime.Pager[InferenceGroupsClientListResponse]` +- New function `*InferenceGroupsClient.NewListSKUsPager(string, string, string, string, *InferenceGroupsClientListSKUsOptions) *runtime.Pager[InferenceGroupsClientListSKUsResponse]` +- New function `*InferenceGroupsClient.BeginUpdate(context.Context, string, string, string, string, PartialMinimalTrackedResourceWithSKU, *InferenceGroupsClientBeginUpdateOptions) (*runtime.Poller[InferenceGroupsClientUpdateResponse], error)` +- New function `NewInferencePoolsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*InferencePoolsClient, error)` +- New function `*InferencePoolsClient.BeginCreateOrUpdate(context.Context, string, string, string, InferencePool, *InferencePoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InferencePoolsClientCreateOrUpdateResponse], error)` +- New function `*InferencePoolsClient.BeginDelete(context.Context, string, string, string, *InferencePoolsClientBeginDeleteOptions) (*runtime.Poller[InferencePoolsClientDeleteResponse], error)` +- New function `*InferencePoolsClient.Get(context.Context, string, string, string, *InferencePoolsClientGetOptions) (InferencePoolsClientGetResponse, error)` +- New function `*InferencePoolsClient.GetStatus(context.Context, string, string, string, *InferencePoolsClientGetStatusOptions) (InferencePoolsClientGetStatusResponse, error)` +- New function `*InferencePoolsClient.NewListPager(string, string, *InferencePoolsClientListOptions) *runtime.Pager[InferencePoolsClientListResponse]` +- New function `*InferencePoolsClient.NewListSKUsPager(string, string, string, *InferencePoolsClientListSKUsOptions) *runtime.Pager[InferencePoolsClientListSKUsResponse]` +- New function `*InferencePoolsClient.BeginUpdate(context.Context, string, string, string, PartialMinimalTrackedResourceWithSKUAndIdentity, *InferencePoolsClientBeginUpdateOptions) (*runtime.Poller[InferencePoolsClientUpdateResponse], error)` +- New function `*InferencingServer.GetInferencingServer() *InferencingServer` +- New function `*JobsClient.Update(context.Context, string, string, string, PartialJobBasePartialResource, *JobsClientUpdateOptions) (JobsClientUpdateResponse, error)` +- New function `*KerberosKeytabCredentials.GetDatastoreCredentials() *DatastoreCredentials` +- New function `*KerberosKeytabSecrets.GetDatastoreSecrets() *DatastoreSecrets` +- New function `*KerberosPasswordCredentials.GetDatastoreCredentials() *DatastoreCredentials` +- New function `*KerberosPasswordSecrets.GetDatastoreSecrets() *DatastoreSecrets` +- New function `*LabelingJobImageProperties.GetLabelingJobMediaProperties() *LabelingJobMediaProperties` +- New function `*LabelingJobMediaProperties.GetLabelingJobMediaProperties() *LabelingJobMediaProperties` +- New function `*LabelingJobProperties.GetJobBaseProperties() *JobBaseProperties` +- New function `*LabelingJobTextProperties.GetLabelingJobMediaProperties() *LabelingJobMediaProperties` +- New function `NewLabelingJobsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LabelingJobsClient, error)` +- New function `*LabelingJobsClient.BeginCreateOrUpdate(context.Context, string, string, string, LabelingJob, *LabelingJobsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LabelingJobsClientCreateOrUpdateResponse], error)` +- New function `*LabelingJobsClient.Delete(context.Context, string, string, string, *LabelingJobsClientDeleteOptions) (LabelingJobsClientDeleteResponse, error)` +- New function `*LabelingJobsClient.BeginExportLabels(context.Context, string, string, string, ExportSummaryClassification, *LabelingJobsClientBeginExportLabelsOptions) (*runtime.Poller[LabelingJobsClientExportLabelsResponse], error)` +- New function `*LabelingJobsClient.Get(context.Context, string, string, string, *LabelingJobsClientGetOptions) (LabelingJobsClientGetResponse, error)` +- New function `*LabelingJobsClient.NewListPager(string, string, *LabelingJobsClientListOptions) *runtime.Pager[LabelingJobsClientListResponse]` +- New function `*LabelingJobsClient.Pause(context.Context, string, string, string, *LabelingJobsClientPauseOptions) (LabelingJobsClientPauseResponse, error)` +- New function `*LabelingJobsClient.BeginResume(context.Context, string, string, string, *LabelingJobsClientBeginResumeOptions) (*runtime.Poller[LabelingJobsClientResumeResponse], error)` +- New function `*LakeHouseArtifact.GetOneLakeArtifact() *OneLakeArtifact` +- New function `*MLAssistConfiguration.GetMLAssistConfiguration() *MLAssistConfiguration` +- New function `*MLAssistConfigurationDisabled.GetMLAssistConfiguration() *MLAssistConfiguration` +- New function `*MLAssistConfigurationEnabled.GetMLAssistConfiguration() *MLAssistConfiguration` +- New function `*ManagedComputeIdentity.GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase` +- New function `*ManagedIdentityCredential.GetDataReferenceCredential() *DataReferenceCredential` +- New function `NewManagedNetworkProvisionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedNetworkProvisionsClient, error)` +- New function `*ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork(context.Context, string, string, *ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions) (*runtime.Poller[ManagedNetworkProvisionsClientProvisionManagedNetworkResponse], error)` +- New function `NewManagedNetworkSettingsRuleClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedNetworkSettingsRuleClient, error)` +- New function `*ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate(context.Context, string, string, string, OutboundRuleBasicResource, *ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedNetworkSettingsRuleClientCreateOrUpdateResponse], error)` +- New function `*ManagedNetworkSettingsRuleClient.BeginDelete(context.Context, string, string, string, *ManagedNetworkSettingsRuleClientBeginDeleteOptions) (*runtime.Poller[ManagedNetworkSettingsRuleClientDeleteResponse], error)` +- New function `*ManagedNetworkSettingsRuleClient.Get(context.Context, string, string, string, *ManagedNetworkSettingsRuleClientGetOptions) (ManagedNetworkSettingsRuleClientGetResponse, error)` +- New function `*ManagedNetworkSettingsRuleClient.NewListPager(string, string, *ManagedNetworkSettingsRuleClientListOptions) *runtime.Pager[ManagedNetworkSettingsRuleClientListResponse]` +- New function `*ModelPerformanceMetricThresholdBase.GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase` +- New function `*ModelPerformanceSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*ModelVersionsClient.BeginPackage(context.Context, string, string, string, string, PackageRequest, *ModelVersionsClientBeginPackageOptions) (*runtime.Poller[ModelVersionsClientPackageResponse], error)` +- New function `*ModelVersionsClient.BeginPublish(context.Context, string, string, string, string, DestinationAsset, *ModelVersionsClientBeginPublishOptions) (*runtime.Poller[ModelVersionsClientPublishResponse], error)` +- New function `*MonitorComputeConfigurationBase.GetMonitorComputeConfigurationBase() *MonitorComputeConfigurationBase` +- New function `*MonitorComputeIdentityBase.GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase` +- New function `*MonitorServerlessSparkCompute.GetMonitorComputeConfigurationBase() *MonitorComputeConfigurationBase` +- New function `*MonitoringFeatureFilterBase.GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase` +- New function `*MonitoringInputDataBase.GetMonitoringInputDataBase() *MonitoringInputDataBase` +- New function `*MonitoringSignalBase.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*OneLakeArtifact.GetOneLakeArtifact() *OneLakeArtifact` +- New function `*OneLakeDatastore.GetDatastoreProperties() *DatastoreProperties` +- New function `*OutboundRule.GetOutboundRule() *OutboundRule` +- New function `*PackageInputPathBase.GetPackageInputPathBase() *PackageInputPathBase` +- New function `*PackageInputPathID.GetPackageInputPathBase() *PackageInputPathBase` +- New function `*PackageInputPathURL.GetPackageInputPathBase() *PackageInputPathBase` +- New function `*PackageInputPathVersion.GetPackageInputPathBase() *PackageInputPathBase` +- New function `*PendingUploadCredentialDto.GetPendingUploadCredentialDto() *PendingUploadCredentialDto` +- New function `*PredictionDriftMetricThresholdBase.GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase` +- New function `*PredictionDriftMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*PrivateEndpointOutboundRule.GetOutboundRule() *OutboundRule` +- New function `*Ray.GetDistributionConfiguration() *DistributionConfiguration` +- New function `NewRegistriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistriesClient, error)` +- New function `*RegistriesClient.BeginCreateOrUpdate(context.Context, string, string, Registry, *RegistriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistriesClientCreateOrUpdateResponse], error)` +- New function `*RegistriesClient.BeginDelete(context.Context, string, string, *RegistriesClientBeginDeleteOptions) (*runtime.Poller[RegistriesClientDeleteResponse], error)` +- New function `*RegistriesClient.Get(context.Context, string, string, *RegistriesClientGetOptions) (RegistriesClientGetResponse, error)` +- New function `*RegistriesClient.NewListBySubscriptionPager(*RegistriesClientListBySubscriptionOptions) *runtime.Pager[RegistriesClientListBySubscriptionResponse]` +- New function `*RegistriesClient.NewListPager(string, *RegistriesClientListOptions) *runtime.Pager[RegistriesClientListResponse]` +- New function `*RegistriesClient.BeginRemoveRegions(context.Context, string, string, Registry, *RegistriesClientBeginRemoveRegionsOptions) (*runtime.Poller[RegistriesClientRemoveRegionsResponse], error)` +- New function `*RegistriesClient.Update(context.Context, string, string, PartialRegistryPartialTrackedResource, *RegistriesClientUpdateOptions) (RegistriesClientUpdateResponse, error)` +- New function `NewRegistryCodeContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryCodeContainersClient, error)` +- New function `*RegistryCodeContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, CodeContainer, *RegistryCodeContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryCodeContainersClientCreateOrUpdateResponse], error)` +- New function `*RegistryCodeContainersClient.BeginDelete(context.Context, string, string, string, *RegistryCodeContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryCodeContainersClientDeleteResponse], error)` +- New function `*RegistryCodeContainersClient.Get(context.Context, string, string, string, *RegistryCodeContainersClientGetOptions) (RegistryCodeContainersClientGetResponse, error)` +- New function `*RegistryCodeContainersClient.NewListPager(string, string, *RegistryCodeContainersClientListOptions) *runtime.Pager[RegistryCodeContainersClientListResponse]` +- New function `NewRegistryCodeVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryCodeVersionsClient, error)` +- New function `*RegistryCodeVersionsClient.CreateOrGetStartPendingUpload(context.Context, string, string, string, string, PendingUploadRequestDto, *RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions) (RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse, error)` +- New function `*RegistryCodeVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, CodeVersion, *RegistryCodeVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryCodeVersionsClientCreateOrUpdateResponse], error)` +- New function `*RegistryCodeVersionsClient.BeginDelete(context.Context, string, string, string, string, *RegistryCodeVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryCodeVersionsClientDeleteResponse], error)` +- New function `*RegistryCodeVersionsClient.Get(context.Context, string, string, string, string, *RegistryCodeVersionsClientGetOptions) (RegistryCodeVersionsClientGetResponse, error)` +- New function `*RegistryCodeVersionsClient.NewListPager(string, string, string, *RegistryCodeVersionsClientListOptions) *runtime.Pager[RegistryCodeVersionsClientListResponse]` +- New function `NewRegistryComponentContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryComponentContainersClient, error)` +- New function `*RegistryComponentContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, ComponentContainer, *RegistryComponentContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryComponentContainersClientCreateOrUpdateResponse], error)` +- New function `*RegistryComponentContainersClient.BeginDelete(context.Context, string, string, string, *RegistryComponentContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryComponentContainersClientDeleteResponse], error)` +- New function `*RegistryComponentContainersClient.Get(context.Context, string, string, string, *RegistryComponentContainersClientGetOptions) (RegistryComponentContainersClientGetResponse, error)` +- New function `*RegistryComponentContainersClient.NewListPager(string, string, *RegistryComponentContainersClientListOptions) *runtime.Pager[RegistryComponentContainersClientListResponse]` +- New function `NewRegistryComponentVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryComponentVersionsClient, error)` +- New function `*RegistryComponentVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, ComponentVersion, *RegistryComponentVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryComponentVersionsClientCreateOrUpdateResponse], error)` +- New function `*RegistryComponentVersionsClient.BeginDelete(context.Context, string, string, string, string, *RegistryComponentVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryComponentVersionsClientDeleteResponse], error)` +- New function `*RegistryComponentVersionsClient.Get(context.Context, string, string, string, string, *RegistryComponentVersionsClientGetOptions) (RegistryComponentVersionsClientGetResponse, error)` +- New function `*RegistryComponentVersionsClient.NewListPager(string, string, string, *RegistryComponentVersionsClientListOptions) *runtime.Pager[RegistryComponentVersionsClientListResponse]` +- New function `NewRegistryDataContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryDataContainersClient, error)` +- New function `*RegistryDataContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, DataContainer, *RegistryDataContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryDataContainersClientCreateOrUpdateResponse], error)` +- New function `*RegistryDataContainersClient.BeginDelete(context.Context, string, string, string, *RegistryDataContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryDataContainersClientDeleteResponse], error)` +- New function `*RegistryDataContainersClient.Get(context.Context, string, string, string, *RegistryDataContainersClientGetOptions) (RegistryDataContainersClientGetResponse, error)` +- New function `*RegistryDataContainersClient.NewListPager(string, string, *RegistryDataContainersClientListOptions) *runtime.Pager[RegistryDataContainersClientListResponse]` +- New function `NewRegistryDataReferencesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryDataReferencesClient, error)` +- New function `*RegistryDataReferencesClient.GetBlobReferenceSAS(context.Context, string, string, string, string, GetBlobReferenceSASRequestDto, *RegistryDataReferencesClientGetBlobReferenceSASOptions) (RegistryDataReferencesClientGetBlobReferenceSASResponse, error)` +- New function `NewRegistryDataVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryDataVersionsClient, error)` +- New function `*RegistryDataVersionsClient.CreateOrGetStartPendingUpload(context.Context, string, string, string, string, PendingUploadRequestDto, *RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions) (RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse, error)` +- New function `*RegistryDataVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, DataVersionBase, *RegistryDataVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryDataVersionsClientCreateOrUpdateResponse], error)` +- New function `*RegistryDataVersionsClient.BeginDelete(context.Context, string, string, string, string, *RegistryDataVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryDataVersionsClientDeleteResponse], error)` +- New function `*RegistryDataVersionsClient.Get(context.Context, string, string, string, string, *RegistryDataVersionsClientGetOptions) (RegistryDataVersionsClientGetResponse, error)` +- New function `*RegistryDataVersionsClient.NewListPager(string, string, string, *RegistryDataVersionsClientListOptions) *runtime.Pager[RegistryDataVersionsClientListResponse]` +- New function `NewRegistryEnvironmentContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryEnvironmentContainersClient, error)` +- New function `*RegistryEnvironmentContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, EnvironmentContainer, *RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryEnvironmentContainersClientCreateOrUpdateResponse], error)` +- New function `*RegistryEnvironmentContainersClient.BeginDelete(context.Context, string, string, string, *RegistryEnvironmentContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryEnvironmentContainersClientDeleteResponse], error)` +- New function `*RegistryEnvironmentContainersClient.Get(context.Context, string, string, string, *RegistryEnvironmentContainersClientGetOptions) (RegistryEnvironmentContainersClientGetResponse, error)` +- New function `*RegistryEnvironmentContainersClient.NewListPager(string, string, *RegistryEnvironmentContainersClientListOptions) *runtime.Pager[RegistryEnvironmentContainersClientListResponse]` +- New function `NewRegistryEnvironmentVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryEnvironmentVersionsClient, error)` +- New function `*RegistryEnvironmentVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, EnvironmentVersion, *RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryEnvironmentVersionsClientCreateOrUpdateResponse], error)` +- New function `*RegistryEnvironmentVersionsClient.BeginDelete(context.Context, string, string, string, string, *RegistryEnvironmentVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryEnvironmentVersionsClientDeleteResponse], error)` +- New function `*RegistryEnvironmentVersionsClient.Get(context.Context, string, string, string, string, *RegistryEnvironmentVersionsClientGetOptions) (RegistryEnvironmentVersionsClientGetResponse, error)` +- New function `*RegistryEnvironmentVersionsClient.NewListPager(string, string, string, *RegistryEnvironmentVersionsClientListOptions) *runtime.Pager[RegistryEnvironmentVersionsClientListResponse]` +- New function `NewRegistryModelContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryModelContainersClient, error)` +- New function `*RegistryModelContainersClient.BeginCreateOrUpdate(context.Context, string, string, string, ModelContainer, *RegistryModelContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryModelContainersClientCreateOrUpdateResponse], error)` +- New function `*RegistryModelContainersClient.BeginDelete(context.Context, string, string, string, *RegistryModelContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryModelContainersClientDeleteResponse], error)` +- New function `*RegistryModelContainersClient.Get(context.Context, string, string, string, *RegistryModelContainersClientGetOptions) (RegistryModelContainersClientGetResponse, error)` +- New function `*RegistryModelContainersClient.NewListPager(string, string, *RegistryModelContainersClientListOptions) *runtime.Pager[RegistryModelContainersClientListResponse]` +- New function `NewRegistryModelVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*RegistryModelVersionsClient, error)` +- New function `*RegistryModelVersionsClient.CreateOrGetStartPendingUpload(context.Context, string, string, string, string, PendingUploadRequestDto, *RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions) (RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse, error)` +- New function `*RegistryModelVersionsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, ModelVersion, *RegistryModelVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryModelVersionsClientCreateOrUpdateResponse], error)` +- New function `*RegistryModelVersionsClient.BeginDelete(context.Context, string, string, string, string, *RegistryModelVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryModelVersionsClientDeleteResponse], error)` +- New function `*RegistryModelVersionsClient.Get(context.Context, string, string, string, string, *RegistryModelVersionsClientGetOptions) (RegistryModelVersionsClientGetResponse, error)` +- New function `*RegistryModelVersionsClient.NewListPager(string, string, string, *RegistryModelVersionsClientListOptions) *runtime.Pager[RegistryModelVersionsClientListResponse]` +- New function `*RegistryModelVersionsClient.BeginPackage(context.Context, string, string, string, string, PackageRequest, *RegistryModelVersionsClientBeginPackageOptions) (*runtime.Poller[RegistryModelVersionsClientPackageResponse], error)` +- New function `*RegressionModelPerformanceMetricThreshold.GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase` +- New function `*RollingInputData.GetMonitoringInputDataBase() *MonitoringInputDataBase` +- New function `*SASCredential.GetDataReferenceCredential() *DataReferenceCredential` +- New function `*SASCredentialDto.GetPendingUploadCredentialDto() *PendingUploadCredentialDto` +- New function `NewServerlessEndpointsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerlessEndpointsClient, error)` +- New function `*ServerlessEndpointsClient.BeginCreateOrUpdate(context.Context, string, string, string, ServerlessEndpoint, *ServerlessEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerlessEndpointsClientCreateOrUpdateResponse], error)` +- New function `*ServerlessEndpointsClient.BeginDelete(context.Context, string, string, string, *ServerlessEndpointsClientBeginDeleteOptions) (*runtime.Poller[ServerlessEndpointsClientDeleteResponse], error)` +- New function `*ServerlessEndpointsClient.Get(context.Context, string, string, string, *ServerlessEndpointsClientGetOptions) (ServerlessEndpointsClientGetResponse, error)` +- New function `*ServerlessEndpointsClient.GetStatus(context.Context, string, string, string, *ServerlessEndpointsClientGetStatusOptions) (ServerlessEndpointsClientGetStatusResponse, error)` +- New function `*ServerlessEndpointsClient.ListKeys(context.Context, string, string, string, *ServerlessEndpointsClientListKeysOptions) (ServerlessEndpointsClientListKeysResponse, error)` +- New function `*ServerlessEndpointsClient.NewListPager(string, string, *ServerlessEndpointsClientListOptions) *runtime.Pager[ServerlessEndpointsClientListResponse]` +- New function `*ServerlessEndpointsClient.BeginRegenerateKeys(context.Context, string, string, string, RegenerateEndpointKeysRequest, *ServerlessEndpointsClientBeginRegenerateKeysOptions) (*runtime.Poller[ServerlessEndpointsClientRegenerateKeysResponse], error)` +- New function `*ServerlessEndpointsClient.BeginUpdate(context.Context, string, string, string, PartialMinimalTrackedResourceWithSKUAndIdentity, *ServerlessEndpointsClientBeginUpdateOptions) (*runtime.Poller[ServerlessEndpointsClientUpdateResponse], error)` +- New function `*ServicePrincipalAuthTypeWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*ServiceTagOutboundRule.GetOutboundRule() *OutboundRule` +- New function `*SparkJob.GetJobBaseProperties() *JobBaseProperties` +- New function `*SparkJobEntry.GetSparkJobEntry() *SparkJobEntry` +- New function `*SparkJobPythonEntry.GetSparkJobEntry() *SparkJobEntry` +- New function `*SparkJobScalaEntry.GetSparkJobEntry() *SparkJobEntry` +- New function `*StaticInputData.GetMonitoringInputDataBase() *MonitoringInputDataBase` +- New function `*TopNFeaturesByAttribution.GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase` +- New function `*TritonInferencingServer.GetInferencingServer() *InferencingServer` +- New function `*Webhook.GetWebhook() *Webhook` +- New function `*WorkspaceConnectionsClient.ListSecrets(context.Context, string, string, string, *WorkspaceConnectionsClientListSecretsOptions) (WorkspaceConnectionsClientListSecretsResponse, error)` +- New function `*WorkspaceConnectionsClient.BeginTestConnection(context.Context, string, string, string, *WorkspaceConnectionsClientBeginTestConnectionOptions) (*runtime.Poller[WorkspaceConnectionsClientTestConnectionResponse], error)` +- New function `*WorkspaceConnectionsClient.Update(context.Context, string, string, string, *WorkspaceConnectionsClientUpdateOptions) (WorkspaceConnectionsClientUpdateResponse, error)` +- New function `dateTimeRFC3339.MarshalText() ([]byte, error)` +- New function `*dateTimeRFC3339.Parse(string) error` +- New function `*dateTimeRFC3339.UnmarshalText([]byte) error` +- New function `*Nodes.GetNodes() *Nodes` +- New function `*NumericalDataDriftMetricThreshold.GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase` +- New function `*NumericalDataQualityMetricThreshold.GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase` +- New function `*NumericalPredictionDriftMetricThreshold.GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase` +- New struct `APIKeyAuthWorkspaceConnectionProperties` +- New struct `AccessKeyAuthTypeWorkspaceConnectionProperties` +- New struct `AcrDetails` +- New struct `ActualCapacityInfo` +- New struct `AllFeatures` +- New struct `AllNodes` +- New struct `AmlTokenComputeIdentity` +- New struct `AnonymousAccessCredential` +- New struct `ArmResourceID` +- New struct `AutoDeleteSetting` +- New struct `AutologgerSettings` +- New struct `AzureDatastore` +- New struct `AzureDevOpsWebhook` +- New struct `AzureMLBatchInferencingServer` +- New struct `AzureMLOnlineInferencingServer` +- New struct `BaseEnvironmentID` +- New struct `BatchPipelineComponentDeploymentConfiguration` +- New struct `BindOptions` +- New struct `BlobReferenceForConsumptionDto` +- New struct `CSVExportSummary` +- New struct `CapacityReservationGroup` +- New struct `CapacityReservationGroupProperties` +- New struct `CapacityReservationGroupTrackedResourceArmPaginatedResult` +- New struct `CategoricalDataDriftMetricThreshold` +- New struct `CategoricalDataQualityMetricThreshold` +- New struct `CategoricalPredictionDriftMetricThreshold` +- New struct `ClassificationModelPerformanceMetricThreshold` +- New struct `CocoExportSummary` +- New struct `Collection` +- New struct `ComponentConfiguration` +- New struct `ComputeInstanceAutologgerSettings` +- New struct `ComputeRecurrenceSchedule` +- New struct `ComputeRuntimeDto` +- New struct `CreateMonitorAction` +- New struct `Cron` +- New struct `CustomInferencingServer` +- New struct `CustomKeys` +- New struct `CustomKeysWorkspaceConnectionProperties` +- New struct `CustomMetricThreshold` +- New struct `CustomMonitoringSignal` +- New struct `CustomService` +- New struct `DataCollector` +- New struct `DataDriftMonitoringSignal` +- New struct `DataImport` +- New struct `DataQualityMonitoringSignal` +- New struct `DatabaseSource` +- New struct `DatasetExportSummary` +- New struct `DestinationAsset` +- New struct `Docker` +- New struct `DockerCredential` +- New struct `EncryptionKeyVaultUpdateProperties` +- New struct `EncryptionUpdateProperties` +- New struct `Endpoint` +- New struct `EnvironmentVariable` +- New struct `FQDNEndpointsPropertyBag` +- New struct `Feature` +- New struct `FeatureAttributionDriftMonitoringSignal` +- New struct `FeatureAttributionMetricThreshold` +- New struct `FeatureImportanceSettings` +- New struct `FeatureProperties` +- New struct `FeatureResourceArmPaginatedResult` +- New struct `FeatureStoreSettings` +- New struct `FeatureSubset` +- New struct `FeatureWindow` +- New struct `FeaturesetContainer` +- New struct `FeaturesetContainerProperties` +- New struct `FeaturesetContainerResourceArmPaginatedResult` +- New struct `FeaturesetSpecification` +- New struct `FeaturesetVersion` +- New struct `FeaturesetVersionBackfillRequest` +- New struct `FeaturesetVersionBackfillResponse` +- New struct `FeaturesetVersionProperties` +- New struct `FeaturesetVersionResourceArmPaginatedResult` +- New struct `FeaturestoreEntityContainer` +- New struct `FeaturestoreEntityContainerProperties` +- New struct `FeaturestoreEntityContainerResourceArmPaginatedResult` +- New struct `FeaturestoreEntityVersion` +- New struct `FeaturestoreEntityVersionProperties` +- New struct `FeaturestoreEntityVersionResourceArmPaginatedResult` +- New struct `FileSystemSource` +- New struct `FixedInputData` +- New struct `FqdnOutboundRule` +- New struct `GenerationSafetyQualityMetricThreshold` +- New struct `GenerationSafetyQualityMonitoringSignal` +- New struct `GenerationTokenUsageMetricThreshold` +- New struct `GenerationTokenUsageSignal` +- New struct `GetBlobReferenceForConsumptionDto` +- New struct `GetBlobReferenceSASRequestDto` +- New struct `GetBlobReferenceSASResponseDto` +- New struct `GroupStatus` +- New struct `HdfsDatastore` +- New struct `IdleShutdownSetting` +- New struct `Image` +- New struct `ImageMetadata` +- New struct `ImportDataAction` +- New struct `IndexColumn` +- New struct `InferenceEndpoint` +- New struct `InferenceEndpointProperties` +- New struct `InferenceEndpointTrackedResourceArmPaginatedResult` +- New struct `InferenceGroup` +- New struct `InferenceGroupProperties` +- New struct `InferenceGroupTrackedResourceArmPaginatedResult` +- New struct `InferencePool` +- New struct `InferencePoolProperties` +- New struct `InferencePoolTrackedResourceArmPaginatedResult` +- New struct `IntellectualProperty` +- New struct `JupyterKernelConfig` +- New struct `KerberosCredentials` +- New struct `KerberosKeytabCredentials` +- New struct `KerberosKeytabSecrets` +- New struct `KerberosPasswordCredentials` +- New struct `KerberosPasswordSecrets` +- New struct `KeyVaultProperties` +- New struct `LabelCategory` +- New struct `LabelClass` +- New struct `LabelingDataConfiguration` +- New struct `LabelingJob` +- New struct `LabelingJobImageProperties` +- New struct `LabelingJobInstructions` +- New struct `LabelingJobProperties` +- New struct `LabelingJobResourceArmPaginatedResult` +- New struct `LabelingJobTextProperties` +- New struct `LakeHouseArtifact` +- New struct `MLAssistConfigurationDisabled` +- New struct `MLAssistConfigurationEnabled` +- New struct `ManagedComputeIdentity` +- New struct `ManagedIdentityCredential` +- New struct `ManagedNetworkProvisionOptions` +- New struct `ManagedNetworkProvisionStatus` +- New struct `ManagedNetworkSettings` +- New struct `MaterializationComputeResource` +- New struct `MaterializationSettings` +- New struct `ModelConfiguration` +- New struct `ModelPackageInput` +- New struct `ModelPerformanceSignal` +- New struct `MonitorDefinition` +- New struct `MonitorEmailNotificationSettings` +- New struct `MonitorNotificationSettings` +- New struct `MonitorServerlessSparkCompute` +- New struct `MonitoringDataSegment` +- New struct `MonitoringTarget` +- New struct `MonitoringThreshold` +- New struct `MonitoringWorkspaceConnection` +- New struct `NlpFixedParameters` +- New struct `NlpParameterSubspace` +- New struct `NlpSweepSettings` +- New struct `NotificationSetting` +- New struct `NumericalDataDriftMetricThreshold` +- New struct `NumericalDataQualityMetricThreshold` +- New struct `NumericalPredictionDriftMetricThreshold` +- New struct `OneLakeDatastore` +- New struct `OnlineInferenceConfiguration` +- New struct `Operation` +- New struct `OperationDisplay` +- New struct `OperationListResult` +- New struct `OsPatchingStatus` +- New struct `OutboundRuleBasicResource` +- New struct `OutboundRuleListResult` +- New struct `PackageInputPathID` +- New struct `PackageInputPathURL` +- New struct `PackageInputPathVersion` +- New struct `PackageRequest` +- New struct `PackageResponse` +- New struct `PartialJobBase` +- New struct `PartialJobBasePartialResource` +- New struct `PartialMinimalTrackedResourceWithSKUAndIdentity` +- New struct `PartialNotificationSetting` +- New struct `PartialRegistryPartialTrackedResource` +- New struct `PendingUploadRequestDto` +- New struct `PendingUploadResponseDto` +- New struct `PoolEnvironmentConfiguration` +- New struct `PoolModelConfiguration` +- New struct `PoolStatus` +- New struct `PredictionDriftMonitoringSignal` +- New struct `PrivateEndpointDestination` +- New struct `PrivateEndpointOutboundRule` +- New struct `PrivateEndpointResource` +- New struct `ProgressMetrics` +- New struct `PropertiesBase` +- New struct `ProxyResource` +- New struct `QueueSettings` +- New struct `Ray` +- New struct `Recurrence` +- New struct `Registry` +- New struct `RegistryPartialManagedServiceIdentity` +- New struct `RegistryPrivateEndpointConnection` +- New struct `RegistryPrivateEndpointConnectionProperties` +- New struct `RegistryPrivateLinkServiceConnectionState` +- New struct `RegistryProperties` +- New struct `RegistryRegionArmDetails` +- New struct `RegistryTrackedResourceArmPaginatedResult` +- New struct `RegressionModelPerformanceMetricThreshold` +- New struct `RequestConfiguration` +- New struct `RequestLogging` +- New struct `ResizeSchema` +- New struct `RollingInputData` +- New struct `SASCredential` +- New struct `SASCredentialDto` +- New struct `SecretConfiguration` +- New struct `ServerlessComputeSettings` +- New struct `ServerlessEndpoint` +- New struct `ServerlessEndpointCapacityReservation` +- New struct `ServerlessEndpointProperties` +- New struct `ServerlessEndpointStatus` +- New struct `ServerlessEndpointTrackedResourceArmPaginatedResult` +- New struct `ServerlessInferenceEndpoint` +- New struct `ServerlessOffer` +- New struct `ServicePrincipalAuthTypeWorkspaceConnectionProperties` +- New struct `ServiceTagDestination` +- New struct `ServiceTagOutboundRule` +- New struct `SparkJob` +- New struct `SparkJobPythonEntry` +- New struct `SparkJobScalaEntry` +- New struct `SparkResourceConfiguration` +- New struct `StaticInputData` +- New struct `StatusMessage` +- New struct `StorageAccountDetails` +- New struct `SystemCreatedAcrAccount` +- New struct `SystemCreatedStorageAccount` +- New struct `TableFixedParameters` +- New struct `TableParameterSubspace` +- New struct `TableSweepSettings` +- New struct `TmpfsOptions` +- New struct `TopNFeaturesByAttribution` +- New struct `TritonInferencingServer` +- New struct `UserCreatedAcrAccount` +- New struct `UserCreatedStorageAccount` +- New struct `VolumeDefinition` +- New struct `VolumeOptions` +- New struct `WorkspaceConnectionAPIKey` +- New struct `WorkspaceConnectionAccessKey` +- New struct `WorkspaceConnectionServicePrincipal` +- New struct `WorkspaceConnectionUpdateParameter` +- New struct `WorkspaceHubConfig` +- New struct `WorkspacePrivateEndpointResource` +- New field `AutoDeleteSetting` in struct `AssetBase` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `AssetJobOutput` +- New field `NotificationSetting`, `QueueSettings`, `SecretsConfiguration` in struct `AutoMLJob` +- New field `IntellectualProperty`, `ResourceGroup`, `SubscriptionID` in struct `AzureBlobDatastore` +- New field `IntellectualProperty`, `ResourceGroup`, `SubscriptionID` in struct `AzureDataLakeGen1Datastore` +- New field `IntellectualProperty`, `ResourceGroup`, `SubscriptionID` in struct `AzureDataLakeGen2Datastore` +- New field `IntellectualProperty`, `ResourceGroup`, `SubscriptionID` in struct `AzureFileDatastore` +- New field `DeploymentConfiguration` in struct `BatchDeploymentProperties` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `Classification` +- New field `TrainingMode` in struct `ClassificationTrainingSettings` +- New field `ProvisioningState` in struct `CodeContainerProperties` +- New field `AutoDeleteSetting`, `ProvisioningState` in struct `CodeVersionProperties` +- New field `Hash`, `HashVersion` in struct `CodeVersionsClientListOptions` +- New field `AutologgerSettings`, `NotificationSetting`, `QueueSettings`, `SecretsConfiguration` in struct `CommandJob` +- New field `ProvisioningState` in struct `ComponentContainerProperties` +- New field `AutoDeleteSetting`, `ProvisioningState`, `Stage` in struct `ComponentVersionProperties` +- New field `Stage` in struct `ComponentVersionsClientListOptions` +- New field `AutologgerSettings`, `CustomServices`, `EnableOSPatching`, `EnableRootAccess`, `EnableSSO`, `IdleTimeBeforeShutdown`, `OSImageMetadata`, `ReleaseQuotaOnStop` in struct `ComputeInstanceProperties` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `CustomModelJobOutput` +- New field `Stage` in struct `DataVersionsClientListOptions` +- New field `Locations`, `MaxInstanceCount` in struct `DeploymentResourceConfiguration` +- New field `RequiredResourceProviders` in struct `DiagnoseRequestProperties` +- New field `CosmosDbResourceID`, `SearchAccountResourceID`, `StorageAccountResourceID` in struct `EncryptionProperty` +- New field `ProvisioningState` in struct `EnvironmentContainerProperties` +- New field `AutoDeleteSetting`, `IntellectualProperty`, `ProvisioningState`, `Stage` in struct `EnvironmentVersionProperties` +- New field `Stage` in struct `EnvironmentVersionsClientListOptions` +- New field `Category`, `Endpoints` in struct `FQDNEndpoints` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `Forecasting` +- New field `FeaturesUnknownAtForecastTime` in struct `ForecastingSettings` +- New field `TrainingMode` in struct `ForecastingTrainingSettings` +- New field `LogTrainingMetrics`, `LogValidationLoss` in struct `ImageModelSettingsObjectDetection` +- New field `Locations`, `MaxInstanceCount` in struct `JobResourceConfiguration` +- New field `Nodes` in struct `JobService` +- New field `AssetName`, `Properties`, `ScheduleID`, `Scheduled` in struct `JobsClientListOptions` +- New field `DataCollector` in struct `KubernetesOnlineDeployment` +- New field `UserStorageArmID` in struct `ListWorkspaceKeysResult` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `MLFlowModelJobOutput` +- New field `AutoDeleteSetting`, `IntellectualProperty`, `Stage` in struct `MLTableData` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `MLTableJobOutput` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `IsSharedToAll`, `Metadata` in struct `ManagedIdentityAuthTypeWorkspaceConnectionProperties` +- New field `DataCollector` in struct `ManagedOnlineDeployment` +- New field `ProvisioningState` in struct `ModelContainerProperties` +- New field `AutoDeleteSetting`, `IntellectualProperty`, `ProvisioningState`, `Stage` in struct `ModelVersionProperties` +- New field `Stage` in struct `ModelVersionsClientListOptions` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `NlpVertical` +- New field `MaxNodes`, `TrialTimeout` in struct `NlpVerticalLimitSettings` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `IsSharedToAll`, `Metadata` in struct `NoneAuthTypeWorkspaceConnectionProperties` +- New field `IsPrivateLinkEnabled` in struct `NotebookResourceInfo` +- New field `DataCollector` in struct `OnlineDeploymentProperties` +- New field `MirrorTraffic` in struct `OnlineEndpointProperties` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `IsSharedToAll`, `Metadata` in struct `PATAuthTypeWorkspaceConnectionProperties` +- New field `NotificationSetting`, `SecretsConfiguration` in struct `PipelineJob` +- New field `Logbase` in struct `RandomSamplingAlgorithm` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `Regression` +- New field `TrainingMode` in struct `RegressionTrainingSettings` +- New field `Locations`, `MaxInstanceCount` in struct `ResourceConfiguration` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `IsSharedToAll`, `Metadata` in struct `SASAuthTypeWorkspaceConnectionProperties` +- New field `ComponentConfiguration`, `NotificationSetting`, `QueueSettings`, `Resources`, `SecretsConfiguration` in struct `SweepJob` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `TableVertical` +- New field `MaxNodes`, `SweepConcurrentTrials`, `SweepTrials` in struct `TableVerticalLimitSettings` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `TextClassification` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `TextClassificationMultilabel` +- New field `FixedParameters`, `SearchSpace`, `SweepSettings` in struct `TextNer` +- New field `TrainingMode` in struct `TrainingSettings` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `TritonModelJobOutput` +- New field `AutoDeleteSetting`, `IntellectualProperty`, `Stage` in struct `URIFileDataVersion` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `URIFileJobOutput` +- New field `AutoDeleteSetting`, `IntellectualProperty`, `Stage` in struct `URIFolderDataVersion` +- New field `AssetName`, `AssetVersion`, `AutoDeleteSetting` in struct `URIFolderJobOutput` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `IsSharedToAll`, `Metadata` in struct `UsernamePasswordAuthTypeWorkspaceConnectionProperties` +- New field `Kind` in struct `Workspace` +- New field `Body` in struct `WorkspaceConnectionsClientCreateOptions` +- New field `AoaiModelsToDeploy` in struct `WorkspaceConnectionsClientGetOptions` +- New field `AssociatedWorkspaces`, `ContainerRegistries`, `EnableDataIsolation`, `ExistingWorkspaces`, `FeatureStoreSettings`, `HubResourceID`, `KeyVaults`, `ManagedNetwork`, `ServerlessComputeSettings`, `SoftDeleteRetentionInDays`, `StorageAccounts`, `SystemDatastoresAuthMode`, `WorkspaceHubConfig` in struct `WorkspaceProperties` +- New field `EnableDataIsolation`, `Encryption`, `FeatureStoreSettings`, `ManagedNetwork`, `ServerlessComputeSettings`, `SoftDeleteRetentionInDays`, `V1LegacyMode` in struct `WorkspacePropertiesUpdateParameters` +- New field `ForceToPurge` in struct `WorkspacesClientBeginDeleteOptions` +- New field `Body` in struct `WorkspacesClientBeginDiagnoseOptions` +- New field `Kind` in struct `WorkspacesClientListByResourceGroupOptions` +- New field `Kind` in struct `WorkspacesClientListBySubscriptionOptions` + + ## 3.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md b/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md index 1ffc0d7ca04e..39f857ce766b 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.1.1 +module-version: 4.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client.go index 54f231135067..812bf17e1e1c 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type BatchDeploymentsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBatchDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BatchDeploymentsClient, error) { - cl, err := arm.NewClient(moduleName+".BatchDeploymentsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewBatchDeploymentsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates/updates a batch inference deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name @@ -62,29 +61,41 @@ func (client *BatchDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[BatchDeploymentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchDeploymentsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[BatchDeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BatchDeploymentsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Creates/updates a batch inference deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *BatchDeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body BatchDeployment, options *BatchDeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "BatchDeploymentsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -115,16 +126,19 @@ func (client *BatchDeploymentsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Batch Inference deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Endpoint name @@ -137,29 +151,41 @@ func (client *BatchDeploymentsClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[BatchDeploymentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchDeploymentsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[BatchDeploymentsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BatchDeploymentsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Delete Batch Inference deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *BatchDeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "BatchDeploymentsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -190,7 +216,7 @@ func (client *BatchDeploymentsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,25 +225,32 @@ func (client *BatchDeploymentsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets a batch inference deployment by id. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Endpoint name // - deploymentName - The identifier for the Batch deployments. // - options - BatchDeploymentsClientGetOptions contains the optional parameters for the BatchDeploymentsClient.Get method. func (client *BatchDeploymentsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *BatchDeploymentsClientGetOptions) (BatchDeploymentsClientGetResponse, error) { + var err error + const operationName = "BatchDeploymentsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) if err != nil { return BatchDeploymentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BatchDeploymentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BatchDeploymentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BatchDeploymentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -248,7 +281,7 @@ func (client *BatchDeploymentsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +298,7 @@ func (client *BatchDeploymentsClient) getHandleResponse(resp *http.Response) (Ba // NewListPager - Lists Batch inference deployments in the workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Endpoint name @@ -277,25 +310,20 @@ func (client *BatchDeploymentsClient) NewListPager(resourceGroupName string, wor return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *BatchDeploymentsClientListResponse) (BatchDeploymentsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return BatchDeploymentsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BatchDeploymentsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + }, nil) if err != nil { return BatchDeploymentsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BatchDeploymentsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -323,7 +351,7 @@ func (client *BatchDeploymentsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } @@ -350,7 +378,7 @@ func (client *BatchDeploymentsClient) listHandleResponse(resp *http.Response) (B // BeginUpdate - Update a batch inference deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name @@ -364,29 +392,40 @@ func (client *BatchDeploymentsClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[BatchDeploymentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchDeploymentsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[BatchDeploymentsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BatchDeploymentsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Update - Update a batch inference deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *BatchDeploymentsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, options *BatchDeploymentsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "BatchDeploymentsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -417,8 +456,11 @@ func (client *BatchDeploymentsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client_example_test.go deleted file mode 100644 index eca97d6c7d6b..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client_example_test.go +++ /dev/null @@ -1,495 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/list.json -func ExampleBatchDeploymentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBatchDeploymentsClient().NewListPager("test-rg", "my-aml-workspace", "testEndpointName", &armmachinelearning.BatchDeploymentsClientListOptions{OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Skip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BatchDeploymentTrackedResourceArmPaginatedResult = armmachinelearning.BatchDeploymentTrackedResourceArmPaginatedResult{ - // Value: []*armmachinelearning.BatchDeployment{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchDeploymentProperties{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Compute: to.Ptr("string"), - // ErrorThreshold: to.Ptr[int32](1), - // LoggingLevel: to.Ptr(armmachinelearning.BatchLoggingLevelInfo), - // MaxConcurrencyPerInstance: to.Ptr[int32](1), - // MiniBatchSize: to.Ptr[int64](1), - // Model: &armmachinelearning.IDAssetReference{ - // ReferenceType: to.Ptr(armmachinelearning.ReferenceTypeID), - // AssetID: to.Ptr("string"), - // }, - // OutputAction: to.Ptr(armmachinelearning.BatchOutputActionSummaryOnly), - // OutputFileName: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // Resources: &armmachinelearning.DeploymentResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "a3c13e2e-a213-4cac-9f5a-b49966906ad6": nil, - // }, - // }, - // }, - // RetrySettings: &armmachinelearning.BatchRetrySettings{ - // MaxRetries: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/delete.json -func ExampleBatchDeploymentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBatchDeploymentsClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/get.json -func ExampleBatchDeploymentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBatchDeploymentsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BatchDeployment = armmachinelearning.BatchDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchDeploymentProperties{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Compute: to.Ptr("string"), - // ErrorThreshold: to.Ptr[int32](1), - // LoggingLevel: to.Ptr(armmachinelearning.BatchLoggingLevelInfo), - // MaxConcurrencyPerInstance: to.Ptr[int32](1), - // MiniBatchSize: to.Ptr[int64](1), - // Model: &armmachinelearning.IDAssetReference{ - // ReferenceType: to.Ptr(armmachinelearning.ReferenceTypeID), - // AssetID: to.Ptr("string"), - // }, - // OutputAction: to.Ptr(armmachinelearning.BatchOutputActionSummaryOnly), - // OutputFileName: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // Resources: &armmachinelearning.DeploymentResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "843c2bb4-e5f1-4267-98c8-ba22a99dbb00": nil, - // }, - // }, - // }, - // RetrySettings: &armmachinelearning.BatchRetrySettings{ - // MaxRetries: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/update.json -func ExampleBatchDeploymentsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBatchDeploymentsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearning.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties{ - Properties: &armmachinelearning.PartialBatchDeployment{ - Description: to.Ptr("string"), - }, - Tags: map[string]*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BatchDeployment = armmachinelearning.BatchDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchDeploymentProperties{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Compute: to.Ptr("string"), - // ErrorThreshold: to.Ptr[int32](1), - // LoggingLevel: to.Ptr(armmachinelearning.BatchLoggingLevelInfo), - // MaxConcurrencyPerInstance: to.Ptr[int32](1), - // MiniBatchSize: to.Ptr[int64](1), - // Model: &armmachinelearning.IDAssetReference{ - // ReferenceType: to.Ptr(armmachinelearning.ReferenceTypeID), - // AssetID: to.Ptr("string"), - // }, - // OutputAction: to.Ptr(armmachinelearning.BatchOutputActionSummaryOnly), - // OutputFileName: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // Resources: &armmachinelearning.DeploymentResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "1e5e1cf9-b0ea-4cf6-9764-e750bf85c10a": nil, - // }, - // }, - // }, - // RetrySettings: &armmachinelearning.BatchRetrySettings{ - // MaxRetries: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchDeployment/createOrUpdate.json -func ExampleBatchDeploymentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBatchDeploymentsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearning.BatchDeployment{ - Location: to.Ptr("string"), - Tags: map[string]*string{}, - Identity: &armmachinelearning.ManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - "string": {}, - }, - }, - Kind: to.Ptr("string"), - Properties: &armmachinelearning.BatchDeploymentProperties{ - Description: to.Ptr("string"), - CodeConfiguration: &armmachinelearning.CodeConfiguration{ - CodeID: to.Ptr("string"), - ScoringScript: to.Ptr("string"), - }, - EnvironmentID: to.Ptr("string"), - EnvironmentVariables: map[string]*string{ - "string": to.Ptr("string"), - }, - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Compute: to.Ptr("string"), - ErrorThreshold: to.Ptr[int32](1), - LoggingLevel: to.Ptr(armmachinelearning.BatchLoggingLevelInfo), - MaxConcurrencyPerInstance: to.Ptr[int32](1), - MiniBatchSize: to.Ptr[int64](1), - Model: &armmachinelearning.IDAssetReference{ - ReferenceType: to.Ptr(armmachinelearning.ReferenceTypeID), - AssetID: to.Ptr("string"), - }, - OutputAction: to.Ptr(armmachinelearning.BatchOutputActionSummaryOnly), - OutputFileName: to.Ptr("string"), - Resources: &armmachinelearning.DeploymentResourceConfiguration{ - InstanceCount: to.Ptr[int32](1), - InstanceType: to.Ptr("string"), - Properties: map[string]any{ - "string": map[string]any{ - "cd3c37dc-2876-4ca4-8a54-21bd7619724a": nil, - }, - }, - }, - RetrySettings: &armmachinelearning.BatchRetrySettings{ - MaxRetries: to.Ptr[int32](1), - Timeout: to.Ptr("PT5M"), - }, - }, - SKU: &armmachinelearning.SKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BatchDeployment = armmachinelearning.BatchDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchDeploymentProperties{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Compute: to.Ptr("string"), - // ErrorThreshold: to.Ptr[int32](1), - // LoggingLevel: to.Ptr(armmachinelearning.BatchLoggingLevelInfo), - // MaxConcurrencyPerInstance: to.Ptr[int32](1), - // MiniBatchSize: to.Ptr[int64](1), - // Model: &armmachinelearning.IDAssetReference{ - // ReferenceType: to.Ptr(armmachinelearning.ReferenceTypeID), - // AssetID: to.Ptr("string"), - // }, - // OutputAction: to.Ptr(armmachinelearning.BatchOutputActionSummaryOnly), - // OutputFileName: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // Resources: &armmachinelearning.DeploymentResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "4939850d-8eae-4343-8566-0826259a2ad1": nil, - // }, - // }, - // }, - // RetrySettings: &armmachinelearning.BatchRetrySettings{ - // MaxRetries: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client.go index 58214338fdb4..632f0ce9f471 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type BatchEndpointsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBatchEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BatchEndpointsClient, error) { - cl, err := arm.NewClient(moduleName+".BatchEndpointsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewBatchEndpointsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a batch inference endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Name for the Batch inference endpoint. @@ -61,29 +60,41 @@ func (client *BatchEndpointsClient) BeginCreateOrUpdate(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[BatchEndpointsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchEndpointsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[BatchEndpointsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BatchEndpointsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Creates a batch inference endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *BatchEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body BatchEndpoint, options *BatchEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "BatchEndpointsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,16 +121,19 @@ func (client *BatchEndpointsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Batch Inference Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference Endpoint name. @@ -131,29 +145,41 @@ func (client *BatchEndpointsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[BatchEndpointsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchEndpointsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[BatchEndpointsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BatchEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Delete Batch Inference Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *BatchEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "BatchEndpointsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -180,7 +206,7 @@ func (client *BatchEndpointsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,24 +215,31 @@ func (client *BatchEndpointsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a batch inference endpoint by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Name for the Batch Endpoint. // - options - BatchEndpointsClientGetOptions contains the optional parameters for the BatchEndpointsClient.Get method. func (client *BatchEndpointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientGetOptions) (BatchEndpointsClientGetResponse, error) { + var err error + const operationName = "BatchEndpointsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return BatchEndpointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BatchEndpointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BatchEndpointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BatchEndpointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -233,7 +266,7 @@ func (client *BatchEndpointsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +283,7 @@ func (client *BatchEndpointsClient) getHandleResponse(resp *http.Response) (Batc // NewListPager - Lists Batch inference endpoint in the workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - BatchEndpointsClientListOptions contains the optional parameters for the BatchEndpointsClient.NewListPager method. @@ -260,25 +293,20 @@ func (client *BatchEndpointsClient) NewListPager(resourceGroupName string, works return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *BatchEndpointsClientListResponse) (BatchEndpointsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BatchEndpointsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return BatchEndpointsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BatchEndpointsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BatchEndpointsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -302,7 +330,7 @@ func (client *BatchEndpointsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Count != nil { reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) } @@ -326,24 +354,31 @@ func (client *BatchEndpointsClient) listHandleResponse(resp *http.Response) (Bat // ListKeys - Lists batch Inference Endpoint keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference Endpoint name. // - options - BatchEndpointsClientListKeysOptions contains the optional parameters for the BatchEndpointsClient.ListKeys method. func (client *BatchEndpointsClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *BatchEndpointsClientListKeysOptions) (BatchEndpointsClientListKeysResponse, error) { + var err error + const operationName = "BatchEndpointsClient.ListKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return BatchEndpointsClientListKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BatchEndpointsClientListKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BatchEndpointsClientListKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BatchEndpointsClientListKeysResponse{}, err } - return client.listKeysHandleResponse(resp) + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err } // listKeysCreateRequest creates the ListKeys request. @@ -370,7 +405,7 @@ func (client *BatchEndpointsClient) listKeysCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +423,7 @@ func (client *BatchEndpointsClient) listKeysHandleResponse(resp *http.Response) // BeginUpdate - Update a batch inference endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Name for the Batch inference endpoint. @@ -401,29 +436,40 @@ func (client *BatchEndpointsClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[BatchEndpointsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[BatchEndpointsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BatchEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Update - Update a batch inference endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *BatchEndpointsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *BatchEndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "BatchEndpointsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -450,8 +496,11 @@ func (client *BatchEndpointsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client_example_test.go deleted file mode 100644 index f8c6b99dc25b..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client_example_test.go +++ /dev/null @@ -1,387 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/list.json -func ExampleBatchEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBatchEndpointsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.BatchEndpointsClientListOptions{Count: to.Ptr[int32](1), - Skip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BatchEndpointTrackedResourceArmPaginatedResult = armmachinelearning.BatchEndpointTrackedResourceArmPaginatedResult{ - // Value: []*armmachinelearning.BatchEndpoint{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Defaults: &armmachinelearning.BatchEndpointDefaults{ - // DeploymentName: to.Ptr("string"), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/delete.json -func ExampleBatchEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBatchEndpointsClient().BeginDelete(ctx, "resourceGroup-1234", "testworkspace", "testBatchEndpoint", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/get.json -func ExampleBatchEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBatchEndpointsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BatchEndpoint = armmachinelearning.BatchEndpoint{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Defaults: &armmachinelearning.BatchEndpointDefaults{ - // DeploymentName: to.Ptr("string"), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/update.json -func ExampleBatchEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBatchEndpointsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearning.PartialMinimalTrackedResourceWithIdentity{ - Tags: map[string]*string{}, - Identity: &armmachinelearning.PartialManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]any{ - "string": map[string]any{}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BatchEndpoint = armmachinelearning.BatchEndpoint{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Defaults: &armmachinelearning.BatchEndpointDefaults{ - // DeploymentName: to.Ptr("string"), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.EndpointProvisioningStateSucceeded), - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/createOrUpdate.json -func ExampleBatchEndpointsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBatchEndpointsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearning.BatchEndpoint{ - Location: to.Ptr("string"), - Tags: map[string]*string{}, - Identity: &armmachinelearning.ManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - "string": {}, - }, - }, - Kind: to.Ptr("string"), - Properties: &armmachinelearning.BatchEndpointProperties{ - Description: to.Ptr("string"), - AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Defaults: &armmachinelearning.BatchEndpointDefaults{ - DeploymentName: to.Ptr("string"), - }, - }, - SKU: &armmachinelearning.SKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BatchEndpoint = armmachinelearning.BatchEndpoint{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.BatchEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Defaults: &armmachinelearning.BatchEndpointDefaults{ - // DeploymentName: to.Ptr("string"), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.EndpointProvisioningStateSucceeded), - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/BatchEndpoint/listKeys.json -func ExampleBatchEndpointsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBatchEndpointsClient().ListKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EndpointAuthKeys = armmachinelearning.EndpointAuthKeys{ - // PrimaryKey: to.Ptr("string"), - // SecondaryKey: to.Ptr("string"), - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/capacityreservationgroups_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/capacityreservationgroups_client.go new file mode 100644 index 000000000000..e6183b6ba3ad --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/capacityreservationgroups_client.go @@ -0,0 +1,411 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// CapacityReservationGroupsClient contains the methods for the CapacityReservationGroups group. +// Don't use this type directly, use NewCapacityReservationGroupsClient() instead. +type CapacityReservationGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationGroupsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CapacityReservationGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate +// method. +func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, groupID string, body CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "CapacityReservationGroupsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, groupID, body, options) + if err != nil { + return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CapacityReservationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, groupID string, body CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if groupID == "" { + return nil, errors.New("parameter groupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *CapacityReservationGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { + result := CapacityReservationGroupsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { + return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete +// method. +func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, groupID string, options *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error) { + var err error + const operationName = "CapacityReservationGroupsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, groupID, options) + if err != nil { + return CapacityReservationGroupsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CapacityReservationGroupsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CapacityReservationGroupsClientDeleteResponse{}, err + } + return CapacityReservationGroupsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, groupID string, options *CapacityReservationGroupsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if groupID == "" { + return nil, errors.New("parameter groupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get +// method. +func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, groupID string, options *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error) { + var err error + const operationName = "CapacityReservationGroupsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, groupID, options) + if err != nil { + return CapacityReservationGroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CapacityReservationGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CapacityReservationGroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *CapacityReservationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, groupID string, options *CapacityReservationGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if groupID == "" { + return nil, errors.New("parameter groupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CapacityReservationGroupsClient) getHandleResponse(resp *http.Response) (CapacityReservationGroupsClientGetResponse, error) { + result := CapacityReservationGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { + return CapacityReservationGroupsClientGetResponse{}, err + } + return result, nil +} + +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - CapacityReservationGroupsClientListOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListPager +// method. +func (client *CapacityReservationGroupsClient) NewListPager(resourceGroupName string, options *CapacityReservationGroupsClientListOptions) *runtime.Pager[CapacityReservationGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListResponse]{ + More: func(page CapacityReservationGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListResponse) (CapacityReservationGroupsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return CapacityReservationGroupsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *CapacityReservationGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CapacityReservationGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CapacityReservationGroupsClient) listHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListResponse, error) { + result := CapacityReservationGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupTrackedResourceArmPaginatedResult); err != nil { + return CapacityReservationGroupsClientListResponse{}, err + } + return result, nil +} + +// - options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager +// method. +func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListBySubscriptionResponse]{ + More: func(page CapacityReservationGroupsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListBySubscriptionResponse) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return CapacityReservationGroupsClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *CapacityReservationGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CapacityReservationGroupsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *CapacityReservationGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { + result := CapacityReservationGroupsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupTrackedResourceArmPaginatedResult); err != nil { + return CapacityReservationGroupsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update +// method. +func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, groupID string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error) { + var err error + const operationName = "CapacityReservationGroupsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, groupID, body, options) + if err != nil { + return CapacityReservationGroupsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CapacityReservationGroupsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CapacityReservationGroupsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *CapacityReservationGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, groupID string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *CapacityReservationGroupsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/capacityReserverationGroups/{groupId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if groupID == "" { + return nil, errors.New("parameter groupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *CapacityReservationGroupsClient) updateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientUpdateResponse, error) { + result := CapacityReservationGroupsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { + return CapacityReservationGroupsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go b/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go index ec015c4f692f..8406e14db719 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -28,7 +27,7 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + _, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -38,137 +37,314 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +// NewBatchDeploymentsClient creates a new instance of BatchDeploymentsClient. +func (c *ClientFactory) NewBatchDeploymentsClient() *BatchDeploymentsClient { + subClient, _ := NewBatchDeploymentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { - subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) +// NewBatchEndpointsClient creates a new instance of BatchEndpointsClient. +func (c *ClientFactory) NewBatchEndpointsClient() *BatchEndpointsClient { + subClient, _ := NewBatchEndpointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) +// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient. +func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient { + subClient, _ := NewCapacityReservationGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { - subClient, _ := NewVirtualMachineSizesClient(c.subscriptionID, c.credential, c.options) +// NewCodeContainersClient creates a new instance of CodeContainersClient. +func (c *ClientFactory) NewCodeContainersClient() *CodeContainersClient { + subClient, _ := NewCodeContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewQuotasClient() *QuotasClient { - subClient, _ := NewQuotasClient(c.subscriptionID, c.credential, c.options) +// NewCodeVersionsClient creates a new instance of CodeVersionsClient. +func (c *ClientFactory) NewCodeVersionsClient() *CodeVersionsClient { + subClient, _ := NewCodeVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewComputeClient() *ComputeClient { - subClient, _ := NewComputeClient(c.subscriptionID, c.credential, c.options) +// NewComponentContainersClient creates a new instance of ComponentContainersClient. +func (c *ClientFactory) NewComponentContainersClient() *ComponentContainersClient { + subClient, _ := NewComponentContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) +// NewComponentVersionsClient creates a new instance of ComponentVersionsClient. +func (c *ClientFactory) NewComponentVersionsClient() *ComponentVersionsClient { + subClient, _ := NewComponentVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) +// NewComputeClient creates a new instance of ComputeClient. +func (c *ClientFactory) NewComputeClient() *ComputeClient { + subClient, _ := NewComputeClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewWorkspaceConnectionsClient() *WorkspaceConnectionsClient { - subClient, _ := NewWorkspaceConnectionsClient(c.subscriptionID, c.credential, c.options) +// NewDataContainersClient creates a new instance of DataContainersClient. +func (c *ClientFactory) NewDataContainersClient() *DataContainersClient { + subClient, _ := NewDataContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBatchEndpointsClient() *BatchEndpointsClient { - subClient, _ := NewBatchEndpointsClient(c.subscriptionID, c.credential, c.options) +// NewDataVersionsClient creates a new instance of DataVersionsClient. +func (c *ClientFactory) NewDataVersionsClient() *DataVersionsClient { + subClient, _ := NewDataVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBatchDeploymentsClient() *BatchDeploymentsClient { - subClient, _ := NewBatchDeploymentsClient(c.subscriptionID, c.credential, c.options) +// NewDatastoresClient creates a new instance of DatastoresClient. +func (c *ClientFactory) NewDatastoresClient() *DatastoresClient { + subClient, _ := NewDatastoresClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCodeContainersClient() *CodeContainersClient { - subClient, _ := NewCodeContainersClient(c.subscriptionID, c.credential, c.options) +// NewEnvironmentContainersClient creates a new instance of EnvironmentContainersClient. +func (c *ClientFactory) NewEnvironmentContainersClient() *EnvironmentContainersClient { + subClient, _ := NewEnvironmentContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCodeVersionsClient() *CodeVersionsClient { - subClient, _ := NewCodeVersionsClient(c.subscriptionID, c.credential, c.options) +// NewEnvironmentVersionsClient creates a new instance of EnvironmentVersionsClient. +func (c *ClientFactory) NewEnvironmentVersionsClient() *EnvironmentVersionsClient { + subClient, _ := NewEnvironmentVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewComponentContainersClient() *ComponentContainersClient { - subClient, _ := NewComponentContainersClient(c.subscriptionID, c.credential, c.options) +// NewFeaturesClient creates a new instance of FeaturesClient. +func (c *ClientFactory) NewFeaturesClient() *FeaturesClient { + subClient, _ := NewFeaturesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewComponentVersionsClient() *ComponentVersionsClient { - subClient, _ := NewComponentVersionsClient(c.subscriptionID, c.credential, c.options) +// NewFeaturesetContainersClient creates a new instance of FeaturesetContainersClient. +func (c *ClientFactory) NewFeaturesetContainersClient() *FeaturesetContainersClient { + subClient, _ := NewFeaturesetContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDataContainersClient() *DataContainersClient { - subClient, _ := NewDataContainersClient(c.subscriptionID, c.credential, c.options) +// NewFeaturesetVersionsClient creates a new instance of FeaturesetVersionsClient. +func (c *ClientFactory) NewFeaturesetVersionsClient() *FeaturesetVersionsClient { + subClient, _ := NewFeaturesetVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDataVersionsClient() *DataVersionsClient { - subClient, _ := NewDataVersionsClient(c.subscriptionID, c.credential, c.options) +// NewFeaturestoreEntityContainersClient creates a new instance of FeaturestoreEntityContainersClient. +func (c *ClientFactory) NewFeaturestoreEntityContainersClient() *FeaturestoreEntityContainersClient { + subClient, _ := NewFeaturestoreEntityContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDatastoresClient() *DatastoresClient { - subClient, _ := NewDatastoresClient(c.subscriptionID, c.credential, c.options) +// NewFeaturestoreEntityVersionsClient creates a new instance of FeaturestoreEntityVersionsClient. +func (c *ClientFactory) NewFeaturestoreEntityVersionsClient() *FeaturestoreEntityVersionsClient { + subClient, _ := NewFeaturestoreEntityVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewEnvironmentContainersClient() *EnvironmentContainersClient { - subClient, _ := NewEnvironmentContainersClient(c.subscriptionID, c.credential, c.options) +// NewInferenceEndpointsClient creates a new instance of InferenceEndpointsClient. +func (c *ClientFactory) NewInferenceEndpointsClient() *InferenceEndpointsClient { + subClient, _ := NewInferenceEndpointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewEnvironmentVersionsClient() *EnvironmentVersionsClient { - subClient, _ := NewEnvironmentVersionsClient(c.subscriptionID, c.credential, c.options) +// NewInferenceGroupsClient creates a new instance of InferenceGroupsClient. +func (c *ClientFactory) NewInferenceGroupsClient() *InferenceGroupsClient { + subClient, _ := NewInferenceGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewInferencePoolsClient creates a new instance of InferencePoolsClient. +func (c *ClientFactory) NewInferencePoolsClient() *InferencePoolsClient { + subClient, _ := NewInferencePoolsClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewJobsClient creates a new instance of JobsClient. func (c *ClientFactory) NewJobsClient() *JobsClient { subClient, _ := NewJobsClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewLabelingJobsClient creates a new instance of LabelingJobsClient. +func (c *ClientFactory) NewLabelingJobsClient() *LabelingJobsClient { + subClient, _ := NewLabelingJobsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewManagedNetworkProvisionsClient creates a new instance of ManagedNetworkProvisionsClient. +func (c *ClientFactory) NewManagedNetworkProvisionsClient() *ManagedNetworkProvisionsClient { + subClient, _ := NewManagedNetworkProvisionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewManagedNetworkSettingsRuleClient creates a new instance of ManagedNetworkSettingsRuleClient. +func (c *ClientFactory) NewManagedNetworkSettingsRuleClient() *ManagedNetworkSettingsRuleClient { + subClient, _ := NewManagedNetworkSettingsRuleClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewModelContainersClient creates a new instance of ModelContainersClient. func (c *ClientFactory) NewModelContainersClient() *ModelContainersClient { subClient, _ := NewModelContainersClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewModelVersionsClient creates a new instance of ModelVersionsClient. func (c *ClientFactory) NewModelVersionsClient() *ModelVersionsClient { subClient, _ := NewModelVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewOnlineDeploymentsClient creates a new instance of OnlineDeploymentsClient. +func (c *ClientFactory) NewOnlineDeploymentsClient() *OnlineDeploymentsClient { + subClient, _ := NewOnlineDeploymentsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewOnlineEndpointsClient creates a new instance of OnlineEndpointsClient. func (c *ClientFactory) NewOnlineEndpointsClient() *OnlineEndpointsClient { subClient, _ := NewOnlineEndpointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOnlineDeploymentsClient() *OnlineDeploymentsClient { - subClient, _ := NewOnlineDeploymentsClient(c.subscriptionID, c.credential, c.options) +// NewOperationsClient creates a new instance of OperationsClient. +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. +func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { + subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewQuotasClient creates a new instance of QuotasClient. +func (c *ClientFactory) NewQuotasClient() *QuotasClient { + subClient, _ := NewQuotasClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewRegistriesClient creates a new instance of RegistriesClient. +func (c *ClientFactory) NewRegistriesClient() *RegistriesClient { + subClient, _ := NewRegistriesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryCodeContainersClient creates a new instance of RegistryCodeContainersClient. +func (c *ClientFactory) NewRegistryCodeContainersClient() *RegistryCodeContainersClient { + subClient, _ := NewRegistryCodeContainersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryCodeVersionsClient creates a new instance of RegistryCodeVersionsClient. +func (c *ClientFactory) NewRegistryCodeVersionsClient() *RegistryCodeVersionsClient { + subClient, _ := NewRegistryCodeVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryComponentContainersClient creates a new instance of RegistryComponentContainersClient. +func (c *ClientFactory) NewRegistryComponentContainersClient() *RegistryComponentContainersClient { + subClient, _ := NewRegistryComponentContainersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryComponentVersionsClient creates a new instance of RegistryComponentVersionsClient. +func (c *ClientFactory) NewRegistryComponentVersionsClient() *RegistryComponentVersionsClient { + subClient, _ := NewRegistryComponentVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryDataContainersClient creates a new instance of RegistryDataContainersClient. +func (c *ClientFactory) NewRegistryDataContainersClient() *RegistryDataContainersClient { + subClient, _ := NewRegistryDataContainersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryDataReferencesClient creates a new instance of RegistryDataReferencesClient. +func (c *ClientFactory) NewRegistryDataReferencesClient() *RegistryDataReferencesClient { + subClient, _ := NewRegistryDataReferencesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryDataVersionsClient creates a new instance of RegistryDataVersionsClient. +func (c *ClientFactory) NewRegistryDataVersionsClient() *RegistryDataVersionsClient { + subClient, _ := NewRegistryDataVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryEnvironmentContainersClient creates a new instance of RegistryEnvironmentContainersClient. +func (c *ClientFactory) NewRegistryEnvironmentContainersClient() *RegistryEnvironmentContainersClient { + subClient, _ := NewRegistryEnvironmentContainersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryEnvironmentVersionsClient creates a new instance of RegistryEnvironmentVersionsClient. +func (c *ClientFactory) NewRegistryEnvironmentVersionsClient() *RegistryEnvironmentVersionsClient { + subClient, _ := NewRegistryEnvironmentVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryModelContainersClient creates a new instance of RegistryModelContainersClient. +func (c *ClientFactory) NewRegistryModelContainersClient() *RegistryModelContainersClient { + subClient, _ := NewRegistryModelContainersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewRegistryModelVersionsClient creates a new instance of RegistryModelVersionsClient. +func (c *ClientFactory) NewRegistryModelVersionsClient() *RegistryModelVersionsClient { + subClient, _ := NewRegistryModelVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewSchedulesClient creates a new instance of SchedulesClient. func (c *ClientFactory) NewSchedulesClient() *SchedulesClient { subClient, _ := NewSchedulesClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewServerlessEndpointsClient creates a new instance of ServerlessEndpointsClient. +func (c *ClientFactory) NewServerlessEndpointsClient() *ServerlessEndpointsClient { + subClient, _ := NewServerlessEndpointsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewUsagesClient creates a new instance of UsagesClient. +func (c *ClientFactory) NewUsagesClient() *UsagesClient { + subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient. +func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { + subClient, _ := NewVirtualMachineSizesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewWorkspaceConnectionsClient creates a new instance of WorkspaceConnectionsClient. +func (c *ClientFactory) NewWorkspaceConnectionsClient() *WorkspaceConnectionsClient { + subClient, _ := NewWorkspaceConnectionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewWorkspaceFeaturesClient creates a new instance of WorkspaceFeaturesClient. func (c *ClientFactory) NewWorkspaceFeaturesClient() *WorkspaceFeaturesClient { subClient, _ := NewWorkspaceFeaturesClient(c.subscriptionID, c.credential, c.options) return subClient } + +// NewWorkspacesClient creates a new instance of WorkspacesClient. +func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { + subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go index aa14d3e59348..37586a502c33 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type CodeContainersClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewCodeContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CodeContainersClient, error) { - cl, err := arm.NewClient(moduleName+".CodeContainersClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,7 +46,7 @@ func NewCodeContainersClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or update container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -55,18 +54,25 @@ func NewCodeContainersClient(subscriptionID string, credential azcore.TokenCrede // - options - CodeContainersClientCreateOrUpdateOptions contains the optional parameters for the CodeContainersClient.CreateOrUpdate // method. func (client *CodeContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body CodeContainer, options *CodeContainersClientCreateOrUpdateOptions) (CodeContainersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "CodeContainersClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return CodeContainersClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CodeContainersClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CodeContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CodeContainersClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -93,10 +99,13 @@ func (client *CodeContainersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -111,22 +120,28 @@ func (client *CodeContainersClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - options - CodeContainersClientDeleteOptions contains the optional parameters for the CodeContainersClient.Delete method. func (client *CodeContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeContainersClientDeleteOptions) (CodeContainersClientDeleteResponse, error) { + var err error + const operationName = "CodeContainersClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return CodeContainersClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CodeContainersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CodeContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CodeContainersClientDeleteResponse{}, err } return CodeContainersClientDeleteResponse{}, nil } @@ -155,7 +170,7 @@ func (client *CodeContainersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,24 +179,31 @@ func (client *CodeContainersClient) deleteCreateRequest(ctx context.Context, res // Get - Get container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - options - CodeContainersClientGetOptions contains the optional parameters for the CodeContainersClient.Get method. func (client *CodeContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *CodeContainersClientGetOptions) (CodeContainersClientGetResponse, error) { + var err error + const operationName = "CodeContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return CodeContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CodeContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CodeContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CodeContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -208,7 +230,7 @@ func (client *CodeContainersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +247,7 @@ func (client *CodeContainersClient) getHandleResponse(resp *http.Response) (Code // NewListPager - List containers. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - CodeContainersClientListOptions contains the optional parameters for the CodeContainersClient.NewListPager method. @@ -235,25 +257,20 @@ func (client *CodeContainersClient) NewListPager(resourceGroupName string, works return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *CodeContainersClientListResponse) (CodeContainersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CodeContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return CodeContainersClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CodeContainersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CodeContainersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -277,7 +294,7 @@ func (client *CodeContainersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client_example_test.go deleted file mode 100644 index 101195c5fa81..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client_example_test.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/list.json -func ExampleCodeContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCodeContainersClient().NewListPager("testrg123", "testworkspace", &armmachinelearning.CodeContainersClientListOptions{Skip: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CodeContainerResourceArmPaginatedResult = armmachinelearning.CodeContainerResourceArmPaginatedResult{ - // Value: []*armmachinelearning.CodeContainer{ - // { - // Name: to.Ptr("testContainer"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/codes"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/codes/testContainer"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeContainerProperties{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "property1": to.Ptr("string"), - // "property2": to.Ptr("string"), - // }, - // }, - // }, - // { - // Name: to.Ptr("testContainer2"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/codes"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/codes/testContainer2"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeContainerProperties{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "property1": to.Ptr("string"), - // "property2": to.Ptr("string"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/delete.json -func ExampleCodeContainersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCodeContainersClient().Delete(ctx, "testrg123", "testworkspace", "testContainer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/get.json -func ExampleCodeContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCodeContainersClient().Get(ctx, "testrg123", "testworkspace", "testContainer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CodeContainer = armmachinelearning.CodeContainer{ - // Name: to.Ptr("testContainer"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/codes"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/codes/testContainer"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeContainerProperties{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "property1": to.Ptr("string"), - // "property2": to.Ptr("string"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeContainer/createOrUpdate.json -func ExampleCodeContainersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCodeContainersClient().CreateOrUpdate(ctx, "testrg123", "testworkspace", "testContainer", armmachinelearning.CodeContainer{ - Properties: &armmachinelearning.CodeContainerProperties{ - Description: to.Ptr("string"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CodeContainer = armmachinelearning.CodeContainer{ - // Name: to.Ptr("testContainer"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/codes"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/codes/testContainer"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeContainerProperties{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "property1": to.Ptr("string"), - // "property2": to.Ptr("string"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client.go index be9271d8a299..c400f67bf692 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type CodeVersionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewCodeVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CodeVersionsClient, error) { - cl, err := arm.NewClient(moduleName+".CodeVersionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -45,10 +44,89 @@ func NewCodeVersionsClient(subscriptionID string, credential azcore.TokenCredent return client, nil } +// CreateOrGetStartPendingUpload - Generate a storage location and credential for the client to upload a code asset to. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Pending upload request object +// - options - CodeVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the CodeVersionsClient.CreateOrGetStartPendingUpload +// method. +func (client *CodeVersionsClient) CreateOrGetStartPendingUpload(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body PendingUploadRequestDto, options *CodeVersionsClientCreateOrGetStartPendingUploadOptions) (CodeVersionsClientCreateOrGetStartPendingUploadResponse, error) { + var err error + const operationName = "CodeVersionsClient.CreateOrGetStartPendingUpload" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrGetStartPendingUploadCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return CodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + resp, err := client.createOrGetStartPendingUploadHandleResponse(httpResp) + return resp, err +} + +// createOrGetStartPendingUploadCreateRequest creates the CreateOrGetStartPendingUpload request. +func (client *CodeVersionsClient) createOrGetStartPendingUploadCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body PendingUploadRequestDto, options *CodeVersionsClientCreateOrGetStartPendingUploadOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/startPendingUpload" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// createOrGetStartPendingUploadHandleResponse handles the CreateOrGetStartPendingUpload response. +func (client *CodeVersionsClient) createOrGetStartPendingUploadHandleResponse(resp *http.Response) (CodeVersionsClientCreateOrGetStartPendingUploadResponse, error) { + result := CodeVersionsClientCreateOrGetStartPendingUploadResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PendingUploadResponseDto); err != nil { + return CodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + return result, nil +} + // CreateOrUpdate - Create or update version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -57,18 +135,25 @@ func NewCodeVersionsClient(subscriptionID string, credential azcore.TokenCredent // - options - CodeVersionsClientCreateOrUpdateOptions contains the optional parameters for the CodeVersionsClient.CreateOrUpdate // method. func (client *CodeVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body CodeVersion, options *CodeVersionsClientCreateOrUpdateOptions) (CodeVersionsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "CodeVersionsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) if err != nil { return CodeVersionsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CodeVersionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CodeVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CodeVersionsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,10 +184,13 @@ func (client *CodeVersionsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,23 +205,29 @@ func (client *CodeVersionsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Delete version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - version - Version identifier. This is case-sensitive. // - options - CodeVersionsClientDeleteOptions contains the optional parameters for the CodeVersionsClient.Delete method. func (client *CodeVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *CodeVersionsClientDeleteOptions) (CodeVersionsClientDeleteResponse, error) { + var err error + const operationName = "CodeVersionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return CodeVersionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CodeVersionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CodeVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CodeVersionsClientDeleteResponse{}, err } return CodeVersionsClientDeleteResponse{}, nil } @@ -166,7 +260,7 @@ func (client *CodeVersionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,25 +269,32 @@ func (client *CodeVersionsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - version - Version identifier. This is case-sensitive. // - options - CodeVersionsClientGetOptions contains the optional parameters for the CodeVersionsClient.Get method. func (client *CodeVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *CodeVersionsClientGetOptions) (CodeVersionsClientGetResponse, error) { + var err error + const operationName = "CodeVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return CodeVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CodeVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CodeVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CodeVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -224,7 +325,7 @@ func (client *CodeVersionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +342,7 @@ func (client *CodeVersionsClient) getHandleResponse(resp *http.Response) (CodeVe // NewListPager - List versions. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -252,25 +353,20 @@ func (client *CodeVersionsClient) NewListPager(resourceGroupName string, workspa return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *CodeVersionsClientListResponse) (CodeVersionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return CodeVersionsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CodeVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) if err != nil { return CodeVersionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CodeVersionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -298,7 +394,7 @@ func (client *CodeVersionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } @@ -308,6 +404,12 @@ func (client *CodeVersionsClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + if options != nil && options.Hash != nil { + reqQP.Set("hash", *options.Hash) + } + if options != nil && options.HashVersion != nil { + reqQP.Set("hashVersion", *options.HashVersion) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,3 +423,94 @@ func (client *CodeVersionsClient) listHandleResponse(resp *http.Response) (CodeV } return result, nil } + +// BeginPublish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. +// - version - Version identifier. +// - body - Destination registry info +// - options - CodeVersionsClientBeginPublishOptions contains the optional parameters for the CodeVersionsClient.BeginPublish +// method. +func (client *CodeVersionsClient) BeginPublish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *CodeVersionsClientBeginPublishOptions) (*runtime.Poller[CodeVersionsClientPublishResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.publish(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CodeVersionsClientPublishResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CodeVersionsClientPublishResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Publish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *CodeVersionsClient) publish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *CodeVersionsClientBeginPublishOptions) (*http.Response, error) { + var err error + const operationName = "CodeVersionsClient.BeginPublish" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.publishCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// publishCreateRequest creates the Publish request. +func (client *CodeVersionsClient) publishCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *CodeVersionsClientBeginPublishOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name}/versions/{version}/publish" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client_example_test.go deleted file mode 100644 index b6361426d039..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/list.json -func ExampleCodeVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCodeVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearning.CodeVersionsClientListOptions{OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Skip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CodeVersionResourceArmPaginatedResult = armmachinelearning.CodeVersionResourceArmPaginatedResult{ - // Value: []*armmachinelearning.CodeVersion{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // CodeURI: to.Ptr("https://blobStorage/folderName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/delete.json -func ExampleCodeVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCodeVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/get.json -func ExampleCodeVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCodeVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CodeVersion = armmachinelearning.CodeVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // CodeURI: to.Ptr("https://blobStorage/folderName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/CodeVersion/createOrUpdate.json -func ExampleCodeVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCodeVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearning.CodeVersion{ - Properties: &armmachinelearning.CodeVersionProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - IsAnonymous: to.Ptr(false), - CodeURI: to.Ptr("https://blobStorage/folderName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CodeVersion = armmachinelearning.CodeVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CodeVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // CodeURI: to.Ptr("https://blobStorage/folderName"), - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client.go index 744dfadbd872..047dc68663c4 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type ComponentContainersClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewComponentContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentContainersClient, error) { - cl, err := arm.NewClient(moduleName+".ComponentContainersClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,7 +46,7 @@ func NewComponentContainersClient(subscriptionID string, credential azcore.Token // CreateOrUpdate - Create or update container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -55,18 +54,25 @@ func NewComponentContainersClient(subscriptionID string, credential azcore.Token // - options - ComponentContainersClientCreateOrUpdateOptions contains the optional parameters for the ComponentContainersClient.CreateOrUpdate // method. func (client *ComponentContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ComponentContainer, options *ComponentContainersClientCreateOrUpdateOptions) (ComponentContainersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "ComponentContainersClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return ComponentContainersClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComponentContainersClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ComponentContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ComponentContainersClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -93,10 +99,13 @@ func (client *ComponentContainersClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -111,23 +120,29 @@ func (client *ComponentContainersClient) createOrUpdateHandleResponse(resp *http // Delete - Delete container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - options - ComponentContainersClientDeleteOptions contains the optional parameters for the ComponentContainersClient.Delete // method. func (client *ComponentContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentContainersClientDeleteOptions) (ComponentContainersClientDeleteResponse, error) { + var err error + const operationName = "ComponentContainersClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return ComponentContainersClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComponentContainersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ComponentContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ComponentContainersClientDeleteResponse{}, err } return ComponentContainersClientDeleteResponse{}, nil } @@ -156,7 +171,7 @@ func (client *ComponentContainersClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -165,24 +180,31 @@ func (client *ComponentContainersClient) deleteCreateRequest(ctx context.Context // Get - Get container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - options - ComponentContainersClientGetOptions contains the optional parameters for the ComponentContainersClient.Get method. func (client *ComponentContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ComponentContainersClientGetOptions) (ComponentContainersClientGetResponse, error) { + var err error + const operationName = "ComponentContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return ComponentContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComponentContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComponentContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComponentContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -209,7 +231,7 @@ func (client *ComponentContainersClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +248,7 @@ func (client *ComponentContainersClient) getHandleResponse(resp *http.Response) // NewListPager - List component containers. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - ComponentContainersClientListOptions contains the optional parameters for the ComponentContainersClient.NewListPager @@ -237,25 +259,20 @@ func (client *ComponentContainersClient) NewListPager(resourceGroupName string, return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ComponentContainersClientListResponse) (ComponentContainersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ComponentContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return ComponentContainersClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ComponentContainersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComponentContainersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -279,7 +296,7 @@ func (client *ComponentContainersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client_example_test.go deleted file mode 100644 index 1c8a7547ad1b..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client_example_test.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/list.json -func ExampleComponentContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewComponentContainersClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.ComponentContainersClientListOptions{Skip: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComponentContainerResourceArmPaginatedResult = armmachinelearning.ComponentContainerResourceArmPaginatedResult{ - // Value: []*armmachinelearning.ComponentContainer{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ComponentContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/delete.json -func ExampleComponentContainersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewComponentContainersClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/get.json -func ExampleComponentContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComponentContainersClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComponentContainer = armmachinelearning.ComponentContainer{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ComponentContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentContainer/createOrUpdate.json -func ExampleComponentContainersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComponentContainersClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.ComponentContainer{ - Properties: &armmachinelearning.ComponentContainerProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComponentContainer = armmachinelearning.ComponentContainer{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ComponentContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client.go index 1a6e41534034..578cb11b5234 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type ComponentVersionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewComponentVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComponentVersionsClient, error) { - cl, err := arm.NewClient(moduleName+".ComponentVersionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewComponentVersionsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create or update version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -57,18 +56,25 @@ func NewComponentVersionsClient(subscriptionID string, credential azcore.TokenCr // - options - ComponentVersionsClientCreateOrUpdateOptions contains the optional parameters for the ComponentVersionsClient.CreateOrUpdate // method. func (client *ComponentVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body ComponentVersion, options *ComponentVersionsClientCreateOrUpdateOptions) (ComponentVersionsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "ComponentVersionsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) if err != nil { return ComponentVersionsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComponentVersionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ComponentVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ComponentVersionsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,10 +105,13 @@ func (client *ComponentVersionsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,7 +126,7 @@ func (client *ComponentVersionsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Delete version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -125,16 +134,22 @@ func (client *ComponentVersionsClient) createOrUpdateHandleResponse(resp *http.R // - options - ComponentVersionsClientDeleteOptions contains the optional parameters for the ComponentVersionsClient.Delete // method. func (client *ComponentVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ComponentVersionsClientDeleteOptions) (ComponentVersionsClientDeleteResponse, error) { + var err error + const operationName = "ComponentVersionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return ComponentVersionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComponentVersionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ComponentVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ComponentVersionsClientDeleteResponse{}, err } return ComponentVersionsClientDeleteResponse{}, nil } @@ -167,7 +182,7 @@ func (client *ComponentVersionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,25 +191,32 @@ func (client *ComponentVersionsClient) deleteCreateRequest(ctx context.Context, // Get - Get version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - version - Version identifier. // - options - ComponentVersionsClientGetOptions contains the optional parameters for the ComponentVersionsClient.Get method. func (client *ComponentVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ComponentVersionsClientGetOptions) (ComponentVersionsClientGetResponse, error) { + var err error + const operationName = "ComponentVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return ComponentVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComponentVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComponentVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComponentVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +247,7 @@ func (client *ComponentVersionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +264,7 @@ func (client *ComponentVersionsClient) getHandleResponse(resp *http.Response) (C // NewListPager - List component versions. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Component name. @@ -254,25 +276,20 @@ func (client *ComponentVersionsClient) NewListPager(resourceGroupName string, wo return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ComponentVersionsClientListResponse) (ComponentVersionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ComponentVersionsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ComponentVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) if err != nil { return ComponentVersionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComponentVersionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -300,7 +317,7 @@ func (client *ComponentVersionsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } @@ -313,6 +330,9 @@ func (client *ComponentVersionsClient) listCreateRequest(ctx context.Context, re if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,3 +346,94 @@ func (client *ComponentVersionsClient) listHandleResponse(resp *http.Response) ( } return result, nil } + +// BeginPublish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. +// - version - Version identifier. +// - body - Destination registry info +// - options - ComponentVersionsClientBeginPublishOptions contains the optional parameters for the ComponentVersionsClient.BeginPublish +// method. +func (client *ComponentVersionsClient) BeginPublish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *ComponentVersionsClientBeginPublishOptions) (*runtime.Poller[ComponentVersionsClientPublishResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.publish(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComponentVersionsClientPublishResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComponentVersionsClientPublishResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Publish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ComponentVersionsClient) publish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *ComponentVersionsClientBeginPublishOptions) (*http.Response, error) { + var err error + const operationName = "ComponentVersionsClient.BeginPublish" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.publishCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// publishCreateRequest creates the Publish request. +func (client *ComponentVersionsClient) publishCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *ComponentVersionsClientBeginPublishOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name}/versions/{version}/publish" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client_example_test.go deleted file mode 100644 index 0390560080e3..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client_example_test.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/list.json -func ExampleComponentVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewComponentVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearning.ComponentVersionsClientListOptions{OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Skip: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComponentVersionResourceArmPaginatedResult = armmachinelearning.ComponentVersionResourceArmPaginatedResult{ - // Value: []*armmachinelearning.ComponentVersion{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ComponentVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // ComponentSpec: map[string]any{ - // "50acbce5-cccc-475a-8ac6-c4da402afbd8": nil, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/delete.json -func ExampleComponentVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewComponentVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/get.json -func ExampleComponentVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComponentVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComponentVersion = armmachinelearning.ComponentVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ComponentVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // ComponentSpec: map[string]any{ - // "1a7c40b5-2029-4f5f-a8d6-fd0822038773": nil, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ComponentVersion/createOrUpdate.json -func ExampleComponentVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComponentVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearning.ComponentVersion{ - Properties: &armmachinelearning.ComponentVersionProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - IsAnonymous: to.Ptr(false), - ComponentSpec: map[string]any{ - "8ced901b-d826-477d-bfef-329da9672513": nil, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComponentVersion = armmachinelearning.ComponentVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ComponentVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // ComponentSpec: map[string]any{ - // "2de2e74e-457d-4447-a581-933abc2b9d96": nil, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client.go index e3e00bdf264d..865dbc715325 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type ComputeClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewComputeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ComputeClient, error) { - cl, err := arm.NewClient(moduleName+".ComputeClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -49,7 +48,7 @@ func NewComputeClient(subscriptionID string, credential azcore.TokenCredential, // exist yet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -62,9 +61,14 @@ func (client *ComputeClient) BeginCreateOrUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[ComputeClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[ComputeClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } @@ -73,20 +77,26 @@ func (client *ComputeClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // exist yet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *ComputeClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource, options *ComputeClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, computeName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,16 +123,19 @@ func (client *ComputeClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes specified Machine Learning compute. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -135,29 +148,40 @@ func (client *ComputeClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ComputeClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[ComputeClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Deletes specified Machine Learning compute. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *ComputeClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction, options *ComputeClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, computeName, underlyingResourceAction, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -184,7 +208,7 @@ func (client *ComputeClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") reqQP.Set("underlyingResourceAction", string(underlyingResourceAction)) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -195,24 +219,31 @@ func (client *ComputeClient) deleteCreateRequest(ctx context.Context, resourceGr // 'keys' nested resource to get them. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. // - options - ComputeClientGetOptions contains the optional parameters for the ComputeClient.Get method. func (client *ComputeClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientGetOptions) (ComputeClientGetResponse, error) { + var err error + const operationName = "ComputeClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) if err != nil { return ComputeClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComputeClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComputeClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComputeClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -239,7 +270,7 @@ func (client *ComputeClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,9 +285,79 @@ func (client *ComputeClient) getHandleResponse(resp *http.Response) (ComputeClie return result, nil } +// GetAllowedResizeSizes - Returns supported virtual machine sizes for resize +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - computeName - Name of the Azure Machine Learning compute. +// - options - ComputeClientGetAllowedResizeSizesOptions contains the optional parameters for the ComputeClient.GetAllowedResizeSizes +// method. +func (client *ComputeClient) GetAllowedResizeSizes(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientGetAllowedResizeSizesOptions) (ComputeClientGetAllowedResizeSizesResponse, error) { + var err error + const operationName = "ComputeClient.GetAllowedResizeSizes" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getAllowedResizeSizesCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + if err != nil { + return ComputeClientGetAllowedResizeSizesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ComputeClientGetAllowedResizeSizesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComputeClientGetAllowedResizeSizesResponse{}, err + } + resp, err := client.getAllowedResizeSizesHandleResponse(httpResp) + return resp, err +} + +// getAllowedResizeSizesCreateRequest creates the GetAllowedResizeSizes request. +func (client *ComputeClient) getAllowedResizeSizesCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientGetAllowedResizeSizesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getAllowedResizeSizesHandleResponse handles the GetAllowedResizeSizes response. +func (client *ComputeClient) getAllowedResizeSizesHandleResponse(resp *http.Response) (ComputeClientGetAllowedResizeSizesResponse, error) { + result := ComputeClientGetAllowedResizeSizesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { + return ComputeClientGetAllowedResizeSizesResponse{}, err + } + return result, nil +} + // NewListPager - Gets computes in specified workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - ComputeClientListOptions contains the optional parameters for the ComputeClient.NewListPager method. @@ -266,25 +367,20 @@ func (client *ComputeClient) NewListPager(resourceGroupName string, workspaceNam return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ComputeClientListResponse) (ComputeClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ComputeClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ComputeClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return ComputeClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComputeClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -308,7 +404,7 @@ func (client *ComputeClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } @@ -329,24 +425,31 @@ func (client *ComputeClient) listHandleResponse(resp *http.Response) (ComputeCli // ListKeys - Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. // - options - ComputeClientListKeysOptions contains the optional parameters for the ComputeClient.ListKeys method. func (client *ComputeClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientListKeysOptions) (ComputeClientListKeysResponse, error) { + var err error + const operationName = "ComputeClient.ListKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) if err != nil { return ComputeClientListKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComputeClientListKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComputeClientListKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComputeClientListKeysResponse{}, err } - return client.listKeysHandleResponse(resp) + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err } // listKeysCreateRequest creates the ListKeys request. @@ -373,7 +476,7 @@ func (client *ComputeClient) listKeysCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +493,7 @@ func (client *ComputeClient) listKeysHandleResponse(resp *http.Response) (Comput // NewListNodesPager - Get the details (e.g IP address, port etc) of all the compute nodes in the compute. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -401,25 +504,20 @@ func (client *ComputeClient) NewListNodesPager(resourceGroupName string, workspa return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ComputeClientListNodesResponse) (ComputeClientListNodesResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listNodesCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ComputeClientListNodesResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ComputeClient.NewListNodesPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listNodesCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) + }, nil) if err != nil { return ComputeClientListNodesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComputeClientListNodesResponse{}, runtime.NewResponseError(resp) - } return client.listNodesHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -447,7 +545,7 @@ func (client *ComputeClient) listNodesCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -462,10 +560,94 @@ func (client *ComputeClient) listNodesHandleResponse(resp *http.Response) (Compu return result, nil } +// BeginResize - Updates the size of a Compute Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - computeName - Name of the Azure Machine Learning compute. +// - parameters - The object for updating VM size setting of specified Compute Instance. +// - options - ComputeClientBeginResizeOptions contains the optional parameters for the ComputeClient.BeginResize method. +func (client *ComputeClient) BeginResize(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ResizeSchema, options *ComputeClientBeginResizeOptions) (*runtime.Poller[ComputeClientResizeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resize(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientResizeResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientResizeResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Resize - Updates the size of a Compute Instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ComputeClient) resize(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ResizeSchema, options *ComputeClientBeginResizeOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginResize" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.resizeCreateRequest(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// resizeCreateRequest creates the Resize request. +func (client *ComputeClient) resizeCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ResizeSchema, options *ComputeClientBeginResizeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // BeginRestart - Posts a restart action to a compute instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -476,29 +658,40 @@ func (client *ComputeClient) BeginRestart(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ComputeClientRestartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientRestartResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[ComputeClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientRestartResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Restart - Posts a restart action to a compute instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *ComputeClient) restart(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginRestartOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginRestart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.restartCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // restartCreateRequest creates the Restart request. @@ -525,7 +718,7 @@ func (client *ComputeClient) restartCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,7 +727,7 @@ func (client *ComputeClient) restartCreateRequest(ctx context.Context, resourceG // BeginStart - Posts a start action to a compute instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -545,29 +738,40 @@ func (client *ComputeClient) BeginStart(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - return runtime.NewPoller[ComputeClientStartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[ComputeClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Start - Posts a start action to a compute instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *ComputeClient) start(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStartOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginStart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.startCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // startCreateRequest creates the Start request. @@ -594,7 +798,7 @@ func (client *ComputeClient) startCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -603,7 +807,7 @@ func (client *ComputeClient) startCreateRequest(ctx context.Context, resourceGro // BeginStop - Posts a stop action to a compute instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -614,29 +818,40 @@ func (client *ComputeClient) BeginStop(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller[ComputeClientStopResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientStopResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[ComputeClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientStopResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Stop - Posts a stop action to a compute instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *ComputeClient) stop(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *ComputeClientBeginStopOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginStop" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.stopCreateRequest(ctx, resourceGroupName, workspaceName, computeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // stopCreateRequest creates the Stop request. @@ -663,7 +878,7 @@ func (client *ComputeClient) stopCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -673,7 +888,7 @@ func (client *ComputeClient) stopCreateRequest(ctx context.Context, resourceGrou // operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - computeName - Name of the Azure Machine Learning compute. @@ -685,29 +900,40 @@ func (client *ComputeClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ComputeClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ComputeClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[ComputeClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ComputeClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Update - Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *ComputeClient) update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters, options *ComputeClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ComputeClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, computeName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -734,8 +960,139 @@ func (client *ComputeClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// UpdateCustomServices - Updates the custom services list. The list of custom services provided shall be overwritten +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - computeName - Name of the Azure Machine Learning compute. +// - customServices - New list of Custom Services. +// - options - ComputeClientUpdateCustomServicesOptions contains the optional parameters for the ComputeClient.UpdateCustomServices +// method. +func (client *ComputeClient) UpdateCustomServices(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, customServices []*CustomService, options *ComputeClientUpdateCustomServicesOptions) (ComputeClientUpdateCustomServicesResponse, error) { + var err error + const operationName = "ComputeClient.UpdateCustomServices" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCustomServicesCreateRequest(ctx, resourceGroupName, workspaceName, computeName, customServices, options) + if err != nil { + return ComputeClientUpdateCustomServicesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ComputeClientUpdateCustomServicesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComputeClientUpdateCustomServicesResponse{}, err + } + return ComputeClientUpdateCustomServicesResponse{}, nil +} + +// updateCustomServicesCreateRequest creates the UpdateCustomServices request. +func (client *ComputeClient) updateCustomServicesCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, customServices []*CustomService, options *ComputeClientUpdateCustomServicesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, customServices); err != nil { + return nil, err + } + return req, nil +} + +// UpdateIdleShutdownSetting - Updates the idle shutdown setting of a compute instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - computeName - Name of the Azure Machine Learning compute. +// - parameters - The object for updating idle shutdown setting of specified ComputeInstance. +// - options - ComputeClientUpdateIdleShutdownSettingOptions contains the optional parameters for the ComputeClient.UpdateIdleShutdownSetting +// method. +func (client *ComputeClient) UpdateIdleShutdownSetting(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters IdleShutdownSetting, options *ComputeClientUpdateIdleShutdownSettingOptions) (ComputeClientUpdateIdleShutdownSettingResponse, error) { + var err error + const operationName = "ComputeClient.UpdateIdleShutdownSetting" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateIdleShutdownSettingCreateRequest(ctx, resourceGroupName, workspaceName, computeName, parameters, options) + if err != nil { + return ComputeClientUpdateIdleShutdownSettingResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ComputeClientUpdateIdleShutdownSettingResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComputeClientUpdateIdleShutdownSettingResponse{}, err + } + return ComputeClientUpdateIdleShutdownSettingResponse{}, nil +} + +// updateIdleShutdownSettingCreateRequest creates the UpdateIdleShutdownSetting request. +func (client *ComputeClient) updateIdleShutdownSettingCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters IdleShutdownSetting, options *ComputeClientUpdateIdleShutdownSettingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if computeName == "" { + return nil, errors.New("parameter computeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{computeName}", url.PathEscape(computeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client_example_test.go deleted file mode 100644 index ef9d3e40bc79..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client_example_test.go +++ /dev/null @@ -1,1001 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/list.json -func ExampleComputeClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewComputeClient().NewListPager("testrg123", "workspaces123", &armmachinelearning.ComputeClientListOptions{Skip: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PaginatedComputeResourcesList = armmachinelearning.PaginatedComputeResourcesList{ - // Value: []*armmachinelearning.ComputeResource{ - // { - // Properties: &armmachinelearning.AKS{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // }, - // { - // Properties: &armmachinelearning.AKS{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute1234-56826-c9b00420020b2"), - // }, - // Name: to.Ptr("compute1234"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute1234"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AKSCompute.json -func ExampleComputeClient_Get_getAAksCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AKS{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/AmlCompute.json -func ExampleComputeClient_Get_getAAmlCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AmlCompute{ - // Properties: &armmachinelearning.AmlComputeProperties{ - // AllocationState: to.Ptr(armmachinelearning.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-27T22:28:08.998Z"); return t}()), - // CurrentNodeCount: to.Ptr[int32](0), - // EnableNodePublicIP: to.Ptr(true), - // IsolatedNetwork: to.Ptr(false), - // NodeStateCounts: &armmachinelearning.NodeStateCounts{ - // IdleNodeCount: to.Ptr[int32](0), - // LeavingNodeCount: to.Ptr[int32](0), - // PreemptedNodeCount: to.Ptr[int32](0), - // PreparingNodeCount: to.Ptr[int32](0), - // RunningNodeCount: to.Ptr[int32](0), - // UnusableNodeCount: to.Ptr[int32](0), - // }, - // OSType: to.Ptr(armmachinelearning.OsTypeWindows), - // RemoteLoginPortPublicAccess: to.Ptr(armmachinelearning.RemoteLoginPortPublicAccessEnabled), - // ScaleSettings: &armmachinelearning.ScaleSettings{ - // MaxNodeCount: to.Ptr[int32](1), - // MinNodeCount: to.Ptr[int32](0), - // NodeIdleTimeBeforeScaleDown: to.Ptr("PT5M"), - // }, - // Subnet: &armmachinelearning.ResourceID{ - // ID: to.Ptr("test-subnet-resource-id"), - // }, - // TargetNodeCount: to.Ptr[int32](1), - // VMPriority: to.Ptr(armmachinelearning.VMPriorityDedicated), - // VMSize: to.Ptr("STANDARD_NC6"), - // }, - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAmlCompute), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus2"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/KubernetesCompute.json -func ExampleComputeClient_Get_getAKubernetesCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.Kubernetes{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeKubernetes), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // IsAttachedCompute: to.Ptr(true), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - // Properties: &armmachinelearning.KubernetesProperties{ - // DefaultInstanceType: to.Ptr("defaultInstanceType"), - // ExtensionInstanceReleaseTrain: to.Ptr("stable"), - // InstanceTypes: map[string]*armmachinelearning.InstanceTypeSchema{ - // "defaultInstanceType": &armmachinelearning.InstanceTypeSchema{ - // Resources: &armmachinelearning.InstanceTypeSchemaResources{ - // Limits: map[string]*string{ - // "cpu": to.Ptr("1"), - // "memory": to.Ptr("4Gi"), - // "nvidia.com/gpu": nil, - // }, - // Requests: map[string]*string{ - // "cpu": to.Ptr("1"), - // "memory": to.Ptr("4Gi"), - // "nvidia.com/gpu": nil, - // }, - // }, - // }, - // }, - // Namespace: to.Ptr("default"), - // }, - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/get/ComputeInstance.json -func ExampleComputeClient_Get_getAnComputeInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComputeClient().Get(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.ComputeInstance{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // Properties: &armmachinelearning.ComputeInstanceProperties{ - // ApplicationSharingPolicy: to.Ptr(armmachinelearning.ApplicationSharingPolicyShared), - // Applications: []*armmachinelearning.ComputeInstanceApplication{ - // { - // DisplayName: to.Ptr("Jupyter"), - // EndpointURI: to.Ptr("https://compute123.eastus2.azureml.net/jupyter"), - // }}, - // ComputeInstanceAuthorizationType: to.Ptr(armmachinelearning.ComputeInstanceAuthorizationTypePersonal), - // ConnectivityEndpoints: &armmachinelearning.ComputeInstanceConnectivityEndpoints{ - // PrivateIPAddress: to.Ptr("10.0.0.1"), - // PublicIPAddress: to.Ptr("10.0.0.1"), - // }, - // CreatedBy: &armmachinelearning.ComputeInstanceCreatedBy{ - // UserID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserName: to.Ptr("foobar@microsoft.com"), - // UserOrgID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // PersonalComputeInstanceSettings: &armmachinelearning.PersonalComputeInstanceSettings{ - // AssignedUser: &armmachinelearning.AssignedUser{ - // ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // SSHSettings: &armmachinelearning.ComputeInstanceSSHSettings{ - // AdminUserName: to.Ptr("azureuser"), - // SSHPort: to.Ptr[int32](22), - // SSHPublicAccess: to.Ptr(armmachinelearning.SSHPublicAccessEnabled), - // }, - // State: to.Ptr(armmachinelearning.ComputeInstanceStateRunning), - // Subnet: &armmachinelearning.ResourceID{ - // ID: to.Ptr("test-subnet-resource-id"), - // }, - // VMSize: to.Ptr("STANDARD_NC6"), - // }, - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus2"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/KubernetesCompute.json -func ExampleComputeClient_BeginCreateOrUpdate_attachAKubernetesCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.Kubernetes{ - Description: to.Ptr("some compute"), - ComputeType: to.Ptr(armmachinelearning.ComputeTypeKubernetes), - ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - Properties: &armmachinelearning.KubernetesProperties{ - DefaultInstanceType: to.Ptr("defaultInstanceType"), - InstanceTypes: map[string]*armmachinelearning.InstanceTypeSchema{ - "defaultInstanceType": { - Resources: &armmachinelearning.InstanceTypeSchemaResources{ - Limits: map[string]*string{ - "cpu": to.Ptr("1"), - "memory": to.Ptr("4Gi"), - "nvidia.com/gpu": nil, - }, - Requests: map[string]*string{ - "cpu": to.Ptr("1"), - "memory": to.Ptr("4Gi"), - "nvidia.com/gpu": nil, - }, - }, - }, - }, - Namespace: to.Ptr("default"), - }, - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.Kubernetes{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeKubernetes), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - // Properties: &armmachinelearning.KubernetesProperties{ - // DefaultInstanceType: to.Ptr("defaultInstanceType"), - // ExtensionInstanceReleaseTrain: to.Ptr("stable"), - // InstanceTypes: map[string]*armmachinelearning.InstanceTypeSchema{ - // "defaultInstanceType": &armmachinelearning.InstanceTypeSchema{ - // Resources: &armmachinelearning.InstanceTypeSchemaResources{ - // Limits: map[string]*string{ - // "cpu": to.Ptr("1"), - // "memory": to.Ptr("4Gi"), - // "nvidia.com/gpu": nil, - // }, - // Requests: map[string]*string{ - // "cpu": to.Ptr("1"), - // "memory": to.Ptr("4Gi"), - // "nvidia.com/gpu": nil, - // }, - // }, - // }, - // }, - // Namespace: to.Ptr("default"), - // }, - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAmlCompute.json -func ExampleComputeClient_BeginCreateOrUpdate_createAAmlCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.AmlCompute{ - Properties: &armmachinelearning.AmlComputeProperties{ - EnableNodePublicIP: to.Ptr(true), - IsolatedNetwork: to.Ptr(false), - OSType: to.Ptr(armmachinelearning.OsTypeWindows), - RemoteLoginPortPublicAccess: to.Ptr(armmachinelearning.RemoteLoginPortPublicAccessNotSpecified), - ScaleSettings: &armmachinelearning.ScaleSettings{ - MaxNodeCount: to.Ptr[int32](1), - MinNodeCount: to.Ptr[int32](0), - NodeIdleTimeBeforeScaleDown: to.Ptr("PT5M"), - }, - VirtualMachineImage: &armmachinelearning.VirtualMachineImage{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myImageGallery/images/myImageDefinition/versions/0.0.1"), - }, - VMPriority: to.Ptr(armmachinelearning.VMPriorityDedicated), - VMSize: to.Ptr("STANDARD_NC6"), - }, - ComputeType: to.Ptr(armmachinelearning.ComputeTypeAmlCompute), - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AmlCompute{ - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAmlCompute), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json -func ExampleComputeClient_BeginCreateOrUpdate_createADataFactoryCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.DataFactory{ - ComputeType: to.Ptr(armmachinelearning.ComputeTypeDataFactory), - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.DataFactory{ - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeDataFactory), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/BasicAKSCompute.json -func ExampleComputeClient_BeginCreateOrUpdate_createAnAksCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.AKS{ - ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AKS{ - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstance.json -func ExampleComputeClient_BeginCreateOrUpdate_createAnComputeInstanceCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.ComputeInstance{ - ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - Properties: &armmachinelearning.ComputeInstanceProperties{ - ApplicationSharingPolicy: to.Ptr(armmachinelearning.ApplicationSharingPolicyPersonal), - ComputeInstanceAuthorizationType: to.Ptr(armmachinelearning.ComputeInstanceAuthorizationTypePersonal), - PersonalComputeInstanceSettings: &armmachinelearning.PersonalComputeInstanceSettings{ - AssignedUser: &armmachinelearning.AssignedUser{ - ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, - }, - SSHSettings: &armmachinelearning.ComputeInstanceSSHSettings{ - SSHPublicAccess: to.Ptr(armmachinelearning.SSHPublicAccessDisabled), - }, - Subnet: &armmachinelearning.ResourceID{ - ID: to.Ptr("test-subnet-resource-id"), - }, - VMSize: to.Ptr("STANDARD_NC6"), - }, - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.ComputeInstance{ - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json -func ExampleComputeClient_BeginCreateOrUpdate_createAnComputeInstanceComputeWithSchedules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.ComputeInstance{ - ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - Properties: &armmachinelearning.ComputeInstanceProperties{ - ApplicationSharingPolicy: to.Ptr(armmachinelearning.ApplicationSharingPolicyPersonal), - ComputeInstanceAuthorizationType: to.Ptr(armmachinelearning.ComputeInstanceAuthorizationTypePersonal), - PersonalComputeInstanceSettings: &armmachinelearning.PersonalComputeInstanceSettings{ - AssignedUser: &armmachinelearning.AssignedUser{ - ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, - }, - Schedules: &armmachinelearning.ComputeSchedules{ - ComputeStartStop: []*armmachinelearning.ComputeStartStopSchedule{ - { - Action: to.Ptr(armmachinelearning.ComputePowerActionStop), - Cron: &armmachinelearning.CronTrigger{ - StartTime: to.Ptr("2021-04-23T01:30:00"), - TimeZone: to.Ptr("Pacific Standard Time"), - Expression: to.Ptr("0 18 * * *"), - }, - Status: to.Ptr(armmachinelearning.ScheduleStatusEnabled), - TriggerType: to.Ptr(armmachinelearning.TriggerTypeCron), - }}, - }, - SSHSettings: &armmachinelearning.ComputeInstanceSSHSettings{ - SSHPublicAccess: to.Ptr(armmachinelearning.SSHPublicAccessDisabled), - }, - VMSize: to.Ptr("STANDARD_NC6"), - }, - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.ComputeInstance{ - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json -func ExampleComputeClient_BeginCreateOrUpdate_createAnComputeInstanceComputeWithMinimalInputs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.ComputeInstance{ - ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - Properties: &armmachinelearning.ComputeInstanceProperties{ - VMSize: to.Ptr("STANDARD_NC6"), - }, - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.ComputeInstance{ - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeComputeInstance), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AmlCompute.json -func ExampleComputeClient_BeginCreateOrUpdate_updateAAmlCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.AmlCompute{ - Properties: &armmachinelearning.AmlComputeProperties{ - ScaleSettings: &armmachinelearning.ScaleSettings{ - MaxNodeCount: to.Ptr[int32](4), - MinNodeCount: to.Ptr[int32](4), - NodeIdleTimeBeforeScaleDown: to.Ptr("PT5M"), - }, - }, - Description: to.Ptr("some compute"), - ComputeType: to.Ptr(armmachinelearning.ComputeTypeAmlCompute), - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AmlCompute{ - // Properties: &armmachinelearning.AmlComputeProperties{ - // AllocationState: to.Ptr(armmachinelearning.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-27T22:28:08.998Z"); return t}()), - // CurrentNodeCount: to.Ptr[int32](0), - // EnableNodePublicIP: to.Ptr(true), - // IsolatedNetwork: to.Ptr(false), - // NodeStateCounts: &armmachinelearning.NodeStateCounts{ - // IdleNodeCount: to.Ptr[int32](0), - // LeavingNodeCount: to.Ptr[int32](0), - // PreemptedNodeCount: to.Ptr[int32](0), - // PreparingNodeCount: to.Ptr[int32](0), - // RunningNodeCount: to.Ptr[int32](0), - // UnusableNodeCount: to.Ptr[int32](0), - // }, - // OSType: to.Ptr(armmachinelearning.OsTypeWindows), - // RemoteLoginPortPublicAccess: to.Ptr(armmachinelearning.RemoteLoginPortPublicAccessEnabled), - // ScaleSettings: &armmachinelearning.ScaleSettings{ - // MaxNodeCount: to.Ptr[int32](1), - // MinNodeCount: to.Ptr[int32](0), - // NodeIdleTimeBeforeScaleDown: to.Ptr("PT5M"), - // }, - // Subnet: &armmachinelearning.ResourceID{ - // ID: to.Ptr("test-subnet-resource-id"), - // }, - // TargetNodeCount: to.Ptr[int32](1), - // VMPriority: to.Ptr(armmachinelearning.VMPriorityDedicated), - // VMSize: to.Ptr("STANDARD_NC6"), - // }, - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAmlCompute), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.0000000+00:00"); return t}()), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus2"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/createOrUpdate/AKSCompute.json -func ExampleComputeClient_BeginCreateOrUpdate_updateAnAksCompute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginCreateOrUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ComputeResource{ - Properties: &armmachinelearning.AKS{ - Properties: &armmachinelearning.AKSSchemaProperties{ - AgentCount: to.Ptr[int32](4), - }, - Description: to.Ptr("some compute"), - ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - }, - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AKS{ - // Properties: &armmachinelearning.AKSSchemaProperties{ - // AgentCount: to.Ptr[int32](4), - // }, - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // ResourceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2"), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/patch.json -func ExampleComputeClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginUpdate(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.ClusterUpdateParameters{ - Properties: &armmachinelearning.ClusterUpdateProperties{ - Properties: &armmachinelearning.ScaleSettingsInformation{ - ScaleSettings: &armmachinelearning.ScaleSettings{ - MaxNodeCount: to.Ptr[int32](4), - MinNodeCount: to.Ptr[int32](4), - NodeIdleTimeBeforeScaleDown: to.Ptr("PT5M"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComputeResource = armmachinelearning.ComputeResource{ - // Properties: &armmachinelearning.AmlCompute{ - // Description: to.Ptr("some compute"), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAmlCompute), - // ProvisioningState: to.Ptr(armmachinelearning.ProvisioningStateSucceeded), - // }, - // Name: to.Ptr("compute123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123"), - // Location: to.Ptr("eastus2"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/delete.json -func ExampleComputeClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginDelete(ctx, "testrg123", "workspaces123", "compute123", armmachinelearning.UnderlyingResourceActionDelete, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listNodes.json -func ExampleComputeClient_NewListNodesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewComputeClient().NewListNodesPager("testrg123", "workspaces123", "compute123", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Nodes { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AmlComputeNodesInformation = armmachinelearning.AmlComputeNodesInformation{ - // Nodes: []*armmachinelearning.AmlComputeNodeInformation{ - // { - // NodeID: to.Ptr("tvm-3601533753_1-20170719t162906z"), - // NodeState: to.Ptr(armmachinelearning.NodeStateRunning), - // Port: to.Ptr[int32](50000), - // PrivateIPAddress: to.Ptr("13.84.190.124"), - // PublicIPAddress: to.Ptr("13.84.190.134"), - // RunID: to.Ptr("2f378a44-38f2-443a-9f0d-9909d0b47890"), - // }, - // { - // NodeID: to.Ptr("tvm-3601533753_2-20170719t162906z"), - // NodeState: to.Ptr(armmachinelearning.NodeStateIdle), - // Port: to.Ptr[int32](50001), - // PrivateIPAddress: to.Ptr("13.84.190.124"), - // PublicIPAddress: to.Ptr("13.84.190.134"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/listKeys.json -func ExampleComputeClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComputeClient().ListKeys(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmachinelearning.ComputeClientListKeysResponse{ - // ComputeSecretsClassification: &armmachinelearning.AksComputeSecrets{ - // AdminKubeConfig: to.Ptr("admin kube config..."), - // ImagePullSecretName: to.Ptr("the image pull secret name"), - // UserKubeConfig: to.Ptr("user kube config..."), - // ComputeType: to.Ptr(armmachinelearning.ComputeTypeAKS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/start.json -func ExampleComputeClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginStart(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/stop.json -func ExampleComputeClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginStop(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Compute/restart.json -func ExampleComputeClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewComputeClient().BeginRestart(ctx, "testrg123", "workspaces123", "compute123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/constants.go b/sdk/resourcemanager/machinelearning/armmachinelearning/constants.go index 61c80364cc8a..67722b9ccc9f 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/constants.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/constants.go @@ -3,17 +3,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning const ( - moduleName = "armmachinelearning" - moduleVersion = "v3.1.1" + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning" + moduleVersion = "v4.0.0-beta.1" ) +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + // AllocationState - Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. // There are no changes to the number of compute nodes in the compute in progress. A compute // enters this state when it is created and when no operations are being performed on the compute to change the number of @@ -52,6 +65,59 @@ func PossibleApplicationSharingPolicyValues() []ApplicationSharingPolicy { } } +// AssetProvisioningState - Provisioning state of registry asset. +type AssetProvisioningState string + +const ( + AssetProvisioningStateCanceled AssetProvisioningState = "Canceled" + AssetProvisioningStateCreating AssetProvisioningState = "Creating" + AssetProvisioningStateDeleting AssetProvisioningState = "Deleting" + AssetProvisioningStateFailed AssetProvisioningState = "Failed" + AssetProvisioningStateSucceeded AssetProvisioningState = "Succeeded" + AssetProvisioningStateUpdating AssetProvisioningState = "Updating" +) + +// PossibleAssetProvisioningStateValues returns the possible values for the AssetProvisioningState const type. +func PossibleAssetProvisioningStateValues() []AssetProvisioningState { + return []AssetProvisioningState{ + AssetProvisioningStateCanceled, + AssetProvisioningStateCreating, + AssetProvisioningStateDeleting, + AssetProvisioningStateFailed, + AssetProvisioningStateSucceeded, + AssetProvisioningStateUpdating, + } +} + +// AuthMode - Enum to determine endpoint authentication mode. +type AuthMode string + +const ( + AuthModeAAD AuthMode = "AAD" +) + +// PossibleAuthModeValues returns the possible values for the AuthMode const type. +func PossibleAuthModeValues() []AuthMode { + return []AuthMode{ + AuthModeAAD, + } +} + +type AutoDeleteCondition string + +const ( + AutoDeleteConditionCreatedGreaterThan AutoDeleteCondition = "CreatedGreaterThan" + AutoDeleteConditionLastAccessedGreaterThan AutoDeleteCondition = "LastAccessedGreaterThan" +) + +// PossibleAutoDeleteConditionValues returns the possible values for the AutoDeleteCondition const type. +func PossibleAutoDeleteConditionValues() []AutoDeleteCondition { + return []AutoDeleteCondition{ + AutoDeleteConditionCreatedGreaterThan, + AutoDeleteConditionLastAccessedGreaterThan, + } +} + // AutoRebuildSetting - AutoRebuild setting for the derived image type AutoRebuildSetting string @@ -86,6 +152,36 @@ func PossibleAutosaveValues() []Autosave { } } +// BaseEnvironmentSourceType - Base environment type. +type BaseEnvironmentSourceType string + +const ( + BaseEnvironmentSourceTypeEnvironmentAsset BaseEnvironmentSourceType = "EnvironmentAsset" +) + +// PossibleBaseEnvironmentSourceTypeValues returns the possible values for the BaseEnvironmentSourceType const type. +func PossibleBaseEnvironmentSourceTypeValues() []BaseEnvironmentSourceType { + return []BaseEnvironmentSourceType{ + BaseEnvironmentSourceTypeEnvironmentAsset, + } +} + +// BatchDeploymentConfigurationType - The enumerated property types for batch deployments. +type BatchDeploymentConfigurationType string + +const ( + BatchDeploymentConfigurationTypeModel BatchDeploymentConfigurationType = "Model" + BatchDeploymentConfigurationTypePipelineComponent BatchDeploymentConfigurationType = "PipelineComponent" +) + +// PossibleBatchDeploymentConfigurationTypeValues returns the possible values for the BatchDeploymentConfigurationType const type. +func PossibleBatchDeploymentConfigurationTypeValues() []BatchDeploymentConfigurationType { + return []BatchDeploymentConfigurationType{ + BatchDeploymentConfigurationTypeModel, + BatchDeploymentConfigurationTypePipelineComponent, + } +} + // BatchLoggingLevel - Log verbosity for batch inferencing. Increasing verbosity order for logging is : Warning, Info and // Debug. The default value is Info. type BatchLoggingLevel string @@ -199,6 +295,86 @@ func PossibleCachingValues() []Caching { } } +type CategoricalDataDriftMetric string + +const ( + // CategoricalDataDriftMetricJensenShannonDistance - The Jensen Shannon Distance (JSD) metric. + CategoricalDataDriftMetricJensenShannonDistance CategoricalDataDriftMetric = "JensenShannonDistance" + // CategoricalDataDriftMetricPearsonsChiSquaredTest - The Pearsons Chi Squared Test metric. + CategoricalDataDriftMetricPearsonsChiSquaredTest CategoricalDataDriftMetric = "PearsonsChiSquaredTest" + // CategoricalDataDriftMetricPopulationStabilityIndex - The Population Stability Index (PSI) metric. + CategoricalDataDriftMetricPopulationStabilityIndex CategoricalDataDriftMetric = "PopulationStabilityIndex" +) + +// PossibleCategoricalDataDriftMetricValues returns the possible values for the CategoricalDataDriftMetric const type. +func PossibleCategoricalDataDriftMetricValues() []CategoricalDataDriftMetric { + return []CategoricalDataDriftMetric{ + CategoricalDataDriftMetricJensenShannonDistance, + CategoricalDataDriftMetricPearsonsChiSquaredTest, + CategoricalDataDriftMetricPopulationStabilityIndex, + } +} + +type CategoricalDataQualityMetric string + +const ( + // CategoricalDataQualityMetricDataTypeErrorRate - Calculates the rate of data type errors. + CategoricalDataQualityMetricDataTypeErrorRate CategoricalDataQualityMetric = "DataTypeErrorRate" + // CategoricalDataQualityMetricNullValueRate - Calculates the rate of null values. + CategoricalDataQualityMetricNullValueRate CategoricalDataQualityMetric = "NullValueRate" + // CategoricalDataQualityMetricOutOfBoundsRate - Calculates the rate values are out of bounds. + CategoricalDataQualityMetricOutOfBoundsRate CategoricalDataQualityMetric = "OutOfBoundsRate" +) + +// PossibleCategoricalDataQualityMetricValues returns the possible values for the CategoricalDataQualityMetric const type. +func PossibleCategoricalDataQualityMetricValues() []CategoricalDataQualityMetric { + return []CategoricalDataQualityMetric{ + CategoricalDataQualityMetricDataTypeErrorRate, + CategoricalDataQualityMetricNullValueRate, + CategoricalDataQualityMetricOutOfBoundsRate, + } +} + +type CategoricalPredictionDriftMetric string + +const ( + // CategoricalPredictionDriftMetricJensenShannonDistance - The Jensen Shannon Distance (JSD) metric. + CategoricalPredictionDriftMetricJensenShannonDistance CategoricalPredictionDriftMetric = "JensenShannonDistance" + // CategoricalPredictionDriftMetricPearsonsChiSquaredTest - The Pearsons Chi Squared Test metric. + CategoricalPredictionDriftMetricPearsonsChiSquaredTest CategoricalPredictionDriftMetric = "PearsonsChiSquaredTest" + // CategoricalPredictionDriftMetricPopulationStabilityIndex - The Population Stability Index (PSI) metric. + CategoricalPredictionDriftMetricPopulationStabilityIndex CategoricalPredictionDriftMetric = "PopulationStabilityIndex" +) + +// PossibleCategoricalPredictionDriftMetricValues returns the possible values for the CategoricalPredictionDriftMetric const type. +func PossibleCategoricalPredictionDriftMetricValues() []CategoricalPredictionDriftMetric { + return []CategoricalPredictionDriftMetric{ + CategoricalPredictionDriftMetricJensenShannonDistance, + CategoricalPredictionDriftMetricPearsonsChiSquaredTest, + CategoricalPredictionDriftMetricPopulationStabilityIndex, + } +} + +type ClassificationModelPerformanceMetric string + +const ( + // ClassificationModelPerformanceMetricAccuracy - Calculates the accuracy of the model predictions. + ClassificationModelPerformanceMetricAccuracy ClassificationModelPerformanceMetric = "Accuracy" + // ClassificationModelPerformanceMetricPrecision - Calculates the precision of the model predictions. + ClassificationModelPerformanceMetricPrecision ClassificationModelPerformanceMetric = "Precision" + // ClassificationModelPerformanceMetricRecall - Calculates the recall of the model predictions. + ClassificationModelPerformanceMetricRecall ClassificationModelPerformanceMetric = "Recall" +) + +// PossibleClassificationModelPerformanceMetricValues returns the possible values for the ClassificationModelPerformanceMetric const type. +func PossibleClassificationModelPerformanceMetricValues() []ClassificationModelPerformanceMetric { + return []ClassificationModelPerformanceMetric{ + ClassificationModelPerformanceMetricAccuracy, + ClassificationModelPerformanceMetricPrecision, + ClassificationModelPerformanceMetricRecall, + } +} + // ClassificationModels - Enum for all classification models supported by AutoML. type ClassificationModels string @@ -239,7 +415,7 @@ const ( // tf-idf may also work. ClassificationModelsMultinomialNaiveBayes ClassificationModels = "MultinomialNaiveBayes" // ClassificationModelsRandomForest - 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. ClassificationModelsRandomForest ClassificationModels = "RandomForest" // ClassificationModelsSGD - SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning @@ -386,6 +562,7 @@ const ( ComputeInstanceStateCreating ComputeInstanceState = "Creating" ComputeInstanceStateDeleting ComputeInstanceState = "Deleting" ComputeInstanceStateJobRunning ComputeInstanceState = "JobRunning" + ComputeInstanceStateResizing ComputeInstanceState = "Resizing" ComputeInstanceStateRestarting ComputeInstanceState = "Restarting" ComputeInstanceStateRunning ComputeInstanceState = "Running" ComputeInstanceStateSettingUp ComputeInstanceState = "SettingUp" @@ -406,6 +583,7 @@ func PossibleComputeInstanceStateValues() []ComputeInstanceState { ComputeInstanceStateCreating, ComputeInstanceStateDeleting, ComputeInstanceStateJobRunning, + ComputeInstanceStateResizing, ComputeInstanceStateRestarting, ComputeInstanceStateRunning, ComputeInstanceStateSettingUp, @@ -420,7 +598,7 @@ func PossibleComputeInstanceStateValues() []ComputeInstanceState { } } -// ComputePowerAction - The compute power action. +// ComputePowerAction - [Required] The compute power action. type ComputePowerAction string const ( @@ -436,6 +614,48 @@ func PossibleComputePowerActionValues() []ComputePowerAction { } } +// ComputeRecurrenceFrequency - Enum to describe the frequency of a compute recurrence schedule +type ComputeRecurrenceFrequency string + +const ( + // ComputeRecurrenceFrequencyDay - Day frequency + ComputeRecurrenceFrequencyDay ComputeRecurrenceFrequency = "Day" + // ComputeRecurrenceFrequencyHour - Hour frequency + ComputeRecurrenceFrequencyHour ComputeRecurrenceFrequency = "Hour" + // ComputeRecurrenceFrequencyMinute - Minute frequency + ComputeRecurrenceFrequencyMinute ComputeRecurrenceFrequency = "Minute" + // ComputeRecurrenceFrequencyMonth - Month frequency + ComputeRecurrenceFrequencyMonth ComputeRecurrenceFrequency = "Month" + // ComputeRecurrenceFrequencyWeek - Week frequency + ComputeRecurrenceFrequencyWeek ComputeRecurrenceFrequency = "Week" +) + +// PossibleComputeRecurrenceFrequencyValues returns the possible values for the ComputeRecurrenceFrequency const type. +func PossibleComputeRecurrenceFrequencyValues() []ComputeRecurrenceFrequency { + return []ComputeRecurrenceFrequency{ + ComputeRecurrenceFrequencyDay, + ComputeRecurrenceFrequencyHour, + ComputeRecurrenceFrequencyMinute, + ComputeRecurrenceFrequencyMonth, + ComputeRecurrenceFrequencyWeek, + } +} + +type ComputeTriggerType string + +const ( + ComputeTriggerTypeCron ComputeTriggerType = "Cron" + ComputeTriggerTypeRecurrence ComputeTriggerType = "Recurrence" +) + +// PossibleComputeTriggerTypeValues returns the possible values for the ComputeTriggerType const type. +func PossibleComputeTriggerTypeValues() []ComputeTriggerType { + return []ComputeTriggerType{ + ComputeTriggerTypeCron, + ComputeTriggerTypeRecurrence, + } +} + // ComputeType - The type of compute type ComputeType string @@ -468,24 +688,65 @@ func PossibleComputeTypeValues() []ComputeType { } } +// ComputeWeekDay - Enum of weekday +type ComputeWeekDay string + +const ( + // ComputeWeekDayFriday - Friday weekday + ComputeWeekDayFriday ComputeWeekDay = "Friday" + // ComputeWeekDayMonday - Monday weekday + ComputeWeekDayMonday ComputeWeekDay = "Monday" + // ComputeWeekDaySaturday - Saturday weekday + ComputeWeekDaySaturday ComputeWeekDay = "Saturday" + // ComputeWeekDaySunday - Sunday weekday + ComputeWeekDaySunday ComputeWeekDay = "Sunday" + // ComputeWeekDayThursday - Thursday weekday + ComputeWeekDayThursday ComputeWeekDay = "Thursday" + // ComputeWeekDayTuesday - Tuesday weekday + ComputeWeekDayTuesday ComputeWeekDay = "Tuesday" + // ComputeWeekDayWednesday - Wednesday weekday + ComputeWeekDayWednesday ComputeWeekDay = "Wednesday" +) + +// PossibleComputeWeekDayValues returns the possible values for the ComputeWeekDay const type. +func PossibleComputeWeekDayValues() []ComputeWeekDay { + return []ComputeWeekDay{ + ComputeWeekDayFriday, + ComputeWeekDayMonday, + ComputeWeekDaySaturday, + ComputeWeekDaySunday, + ComputeWeekDayThursday, + ComputeWeekDayTuesday, + ComputeWeekDayWednesday, + } +} + // ConnectionAuthType - Authentication type of the connection target type ConnectionAuthType string const ( + ConnectionAuthTypeAPIKey ConnectionAuthType = "ApiKey" + ConnectionAuthTypeAccessKey ConnectionAuthType = "AccessKey" + ConnectionAuthTypeCustomKeys ConnectionAuthType = "CustomKeys" ConnectionAuthTypeManagedIdentity ConnectionAuthType = "ManagedIdentity" ConnectionAuthTypeNone ConnectionAuthType = "None" ConnectionAuthTypePAT ConnectionAuthType = "PAT" ConnectionAuthTypeSAS ConnectionAuthType = "SAS" + ConnectionAuthTypeServicePrincipal ConnectionAuthType = "ServicePrincipal" ConnectionAuthTypeUsernamePassword ConnectionAuthType = "UsernamePassword" ) // PossibleConnectionAuthTypeValues returns the possible values for the ConnectionAuthType const type. func PossibleConnectionAuthTypeValues() []ConnectionAuthType { return []ConnectionAuthType{ + ConnectionAuthTypeAPIKey, + ConnectionAuthTypeAccessKey, + ConnectionAuthTypeCustomKeys, ConnectionAuthTypeManagedIdentity, ConnectionAuthTypeNone, ConnectionAuthTypePAT, ConnectionAuthTypeSAS, + ConnectionAuthTypeServicePrincipal, ConnectionAuthTypeUsernamePassword, } } @@ -494,24 +755,55 @@ func PossibleConnectionAuthTypeValues() []ConnectionAuthType { type ConnectionCategory string const ( - ConnectionCategoryContainerRegistry ConnectionCategory = "ContainerRegistry" - ConnectionCategoryGit ConnectionCategory = "Git" - ConnectionCategoryPythonFeed ConnectionCategory = "PythonFeed" + ConnectionCategoryADLSGen2 ConnectionCategory = "ADLSGen2" + ConnectionCategoryAPIKey ConnectionCategory = "ApiKey" + ConnectionCategoryAzureMySQLDb ConnectionCategory = "AzureMySqlDb" + ConnectionCategoryAzureOpenAI ConnectionCategory = "AzureOpenAI" + ConnectionCategoryAzurePostgresDb ConnectionCategory = "AzurePostgresDb" + ConnectionCategoryAzureSQLDb ConnectionCategory = "AzureSqlDb" + ConnectionCategoryAzureSynapseAnalytics ConnectionCategory = "AzureSynapseAnalytics" + ConnectionCategoryCognitiveSearch ConnectionCategory = "CognitiveSearch" + ConnectionCategoryCognitiveService ConnectionCategory = "CognitiveService" + ConnectionCategoryContainerRegistry ConnectionCategory = "ContainerRegistry" + ConnectionCategoryCustomKeys ConnectionCategory = "CustomKeys" + ConnectionCategoryGit ConnectionCategory = "Git" + ConnectionCategoryPythonFeed ConnectionCategory = "PythonFeed" + ConnectionCategoryRedis ConnectionCategory = "Redis" + ConnectionCategoryS3 ConnectionCategory = "S3" + ConnectionCategorySnowflake ConnectionCategory = "Snowflake" ) // PossibleConnectionCategoryValues returns the possible values for the ConnectionCategory const type. func PossibleConnectionCategoryValues() []ConnectionCategory { return []ConnectionCategory{ + ConnectionCategoryADLSGen2, + ConnectionCategoryAPIKey, + ConnectionCategoryAzureMySQLDb, + ConnectionCategoryAzureOpenAI, + ConnectionCategoryAzurePostgresDb, + ConnectionCategoryAzureSQLDb, + ConnectionCategoryAzureSynapseAnalytics, + ConnectionCategoryCognitiveSearch, + ConnectionCategoryCognitiveService, ConnectionCategoryContainerRegistry, + ConnectionCategoryCustomKeys, ConnectionCategoryGit, ConnectionCategoryPythonFeed, + ConnectionCategoryRedis, + ConnectionCategoryS3, + ConnectionCategorySnowflake, } } +// ContainerType - The type of container to retrieve logs from. type ContainerType string const ( - ContainerTypeInferenceServer ContainerType = "InferenceServer" + // ContainerTypeInferenceServer - The container used to serve user's request. + ContainerTypeInferenceServer ContainerType = "InferenceServer" + // ContainerTypeModelDataCollector - The container used to collect payload and custom logging when mdc is enabled. + ContainerTypeModelDataCollector ContainerType = "ModelDataCollector" + // ContainerTypeStorageInitializer - The container used to download models and score script. ContainerTypeStorageInitializer ContainerType = "StorageInitializer" ) @@ -519,6 +811,7 @@ const ( func PossibleContainerTypeValues() []ContainerType { return []ContainerType{ ContainerTypeInferenceServer, + ContainerTypeModelDataCollector, ContainerTypeStorageInitializer, } } @@ -549,6 +842,8 @@ type CredentialsType string const ( CredentialsTypeAccountKey CredentialsType = "AccountKey" CredentialsTypeCertificate CredentialsType = "Certificate" + CredentialsTypeKerberosKeytab CredentialsType = "KerberosKeytab" + CredentialsTypeKerberosPassword CredentialsType = "KerberosPassword" CredentialsTypeNone CredentialsType = "None" CredentialsTypeSas CredentialsType = "Sas" CredentialsTypeServicePrincipal CredentialsType = "ServicePrincipal" @@ -559,12 +854,84 @@ func PossibleCredentialsTypeValues() []CredentialsType { return []CredentialsType{ CredentialsTypeAccountKey, CredentialsTypeCertificate, + CredentialsTypeKerberosKeytab, + CredentialsTypeKerberosPassword, CredentialsTypeNone, CredentialsTypeSas, CredentialsTypeServicePrincipal, } } +type DataAvailabilityStatus string + +const ( + DataAvailabilityStatusComplete DataAvailabilityStatus = "Complete" + DataAvailabilityStatusIncomplete DataAvailabilityStatus = "Incomplete" + DataAvailabilityStatusNone DataAvailabilityStatus = "None" + DataAvailabilityStatusPending DataAvailabilityStatus = "Pending" +) + +// PossibleDataAvailabilityStatusValues returns the possible values for the DataAvailabilityStatus const type. +func PossibleDataAvailabilityStatusValues() []DataAvailabilityStatus { + return []DataAvailabilityStatus{ + DataAvailabilityStatusComplete, + DataAvailabilityStatusIncomplete, + DataAvailabilityStatusNone, + DataAvailabilityStatusPending, + } +} + +type DataCollectionMode string + +const ( + DataCollectionModeDisabled DataCollectionMode = "Disabled" + DataCollectionModeEnabled DataCollectionMode = "Enabled" +) + +// PossibleDataCollectionModeValues returns the possible values for the DataCollectionMode const type. +func PossibleDataCollectionModeValues() []DataCollectionMode { + return []DataCollectionMode{ + DataCollectionModeDisabled, + DataCollectionModeEnabled, + } +} + +// DataImportSourceType - Enum to determine the type of data. +type DataImportSourceType string + +const ( + DataImportSourceTypeDatabase DataImportSourceType = "database" + DataImportSourceTypeFileSystem DataImportSourceType = "file_system" +) + +// PossibleDataImportSourceTypeValues returns the possible values for the DataImportSourceType const type. +func PossibleDataImportSourceTypeValues() []DataImportSourceType { + return []DataImportSourceType{ + DataImportSourceTypeDatabase, + DataImportSourceTypeFileSystem, + } +} + +// DataReferenceCredentialType - Enum to determine the DataReference credentials type. +type DataReferenceCredentialType string + +const ( + DataReferenceCredentialTypeDockerCredentials DataReferenceCredentialType = "DockerCredentials" + DataReferenceCredentialTypeManagedIdentity DataReferenceCredentialType = "ManagedIdentity" + DataReferenceCredentialTypeNoCredentials DataReferenceCredentialType = "NoCredentials" + DataReferenceCredentialTypeSAS DataReferenceCredentialType = "SAS" +) + +// PossibleDataReferenceCredentialTypeValues returns the possible values for the DataReferenceCredentialType const type. +func PossibleDataReferenceCredentialTypeValues() []DataReferenceCredentialType { + return []DataReferenceCredentialType{ + DataReferenceCredentialTypeDockerCredentials, + DataReferenceCredentialTypeManagedIdentity, + DataReferenceCredentialTypeNoCredentials, + DataReferenceCredentialTypeSAS, + } +} + // DataType - Enum to determine the type of data. type DataType string @@ -591,6 +958,8 @@ const ( DatastoreTypeAzureDataLakeGen1 DatastoreType = "AzureDataLakeGen1" DatastoreTypeAzureDataLakeGen2 DatastoreType = "AzureDataLakeGen2" DatastoreTypeAzureFile DatastoreType = "AzureFile" + DatastoreTypeHdfs DatastoreType = "Hdfs" + DatastoreTypeOneLake DatastoreType = "OneLake" ) // PossibleDatastoreTypeValues returns the possible values for the DatastoreType const type. @@ -600,6 +969,8 @@ func PossibleDatastoreTypeValues() []DatastoreType { DatastoreTypeAzureDataLakeGen1, DatastoreTypeAzureDataLakeGen2, DatastoreTypeAzureFile, + DatastoreTypeHdfs, + DatastoreTypeOneLake, } } @@ -653,6 +1024,7 @@ type DistributionType string const ( DistributionTypeMpi DistributionType = "Mpi" DistributionTypePyTorch DistributionType = "PyTorch" + DistributionTypeRay DistributionType = "Ray" DistributionTypeTensorFlow DistributionType = "TensorFlow" ) @@ -661,6 +1033,7 @@ func PossibleDistributionTypeValues() []DistributionType { return []DistributionType{ DistributionTypeMpi, DistributionTypePyTorch, + DistributionTypeRay, DistributionTypeTensorFlow, } } @@ -698,6 +1071,24 @@ func PossibleEgressPublicNetworkAccessTypeValues() []EgressPublicNetworkAccessTy } } +// EmailNotificationEnableType - Enum to determine the email notification type. +type EmailNotificationEnableType string + +const ( + EmailNotificationEnableTypeJobCancelled EmailNotificationEnableType = "JobCancelled" + EmailNotificationEnableTypeJobCompleted EmailNotificationEnableType = "JobCompleted" + EmailNotificationEnableTypeJobFailed EmailNotificationEnableType = "JobFailed" +) + +// PossibleEmailNotificationEnableTypeValues returns the possible values for the EmailNotificationEnableType const type. +func PossibleEmailNotificationEnableTypeValues() []EmailNotificationEnableType { + return []EmailNotificationEnableType{ + EmailNotificationEnableTypeJobCancelled, + EmailNotificationEnableTypeJobCompleted, + EmailNotificationEnableTypeJobFailed, + } +} + // EncryptionStatus - Indicates whether or not the encryption is enabled for the workspace. type EncryptionStatus string @@ -774,6 +1165,28 @@ func PossibleEndpointProvisioningStateValues() []EndpointProvisioningState { } } +// EndpointServiceConnectionStatus - Connection status of the service consumer with the service provider +type EndpointServiceConnectionStatus string + +const ( + EndpointServiceConnectionStatusApproved EndpointServiceConnectionStatus = "Approved" + EndpointServiceConnectionStatusDisconnected EndpointServiceConnectionStatus = "Disconnected" + EndpointServiceConnectionStatusPending EndpointServiceConnectionStatus = "Pending" + EndpointServiceConnectionStatusRejected EndpointServiceConnectionStatus = "Rejected" + EndpointServiceConnectionStatusTimeout EndpointServiceConnectionStatus = "Timeout" +) + +// PossibleEndpointServiceConnectionStatusValues returns the possible values for the EndpointServiceConnectionStatus const type. +func PossibleEndpointServiceConnectionStatusValues() []EndpointServiceConnectionStatus { + return []EndpointServiceConnectionStatus{ + EndpointServiceConnectionStatusApproved, + EndpointServiceConnectionStatusDisconnected, + EndpointServiceConnectionStatusPending, + EndpointServiceConnectionStatusRejected, + EndpointServiceConnectionStatusTimeout, + } +} + // EnvironmentType - Environment type is either user created or curated by Azure ML service type EnvironmentType string @@ -790,6 +1203,97 @@ func PossibleEnvironmentTypeValues() []EnvironmentType { } } +// EnvironmentVariableType - Type of the Environment Variable. Possible values are: local - For local variable +type EnvironmentVariableType string + +const ( + EnvironmentVariableTypeLocal EnvironmentVariableType = "local" +) + +// PossibleEnvironmentVariableTypeValues returns the possible values for the EnvironmentVariableType const type. +func PossibleEnvironmentVariableTypeValues() []EnvironmentVariableType { + return []EnvironmentVariableType{ + EnvironmentVariableTypeLocal, + } +} + +// ExportFormatType - The format of exported labels. +type ExportFormatType string + +const ( + ExportFormatTypeCSV ExportFormatType = "CSV" + ExportFormatTypeCoco ExportFormatType = "Coco" + ExportFormatTypeDataset ExportFormatType = "Dataset" +) + +// PossibleExportFormatTypeValues returns the possible values for the ExportFormatType const type. +func PossibleExportFormatTypeValues() []ExportFormatType { + return []ExportFormatType{ + ExportFormatTypeCSV, + ExportFormatTypeCoco, + ExportFormatTypeDataset, + } +} + +type FeatureAttributionMetric string + +const ( + // FeatureAttributionMetricNormalizedDiscountedCumulativeGain - The Normalized Discounted Cumulative Gain metric. + FeatureAttributionMetricNormalizedDiscountedCumulativeGain FeatureAttributionMetric = "NormalizedDiscountedCumulativeGain" +) + +// PossibleFeatureAttributionMetricValues returns the possible values for the FeatureAttributionMetric const type. +func PossibleFeatureAttributionMetricValues() []FeatureAttributionMetric { + return []FeatureAttributionMetric{ + FeatureAttributionMetricNormalizedDiscountedCumulativeGain, + } +} + +type FeatureDataType string + +const ( + FeatureDataTypeBinary FeatureDataType = "Binary" + FeatureDataTypeBoolean FeatureDataType = "Boolean" + FeatureDataTypeDatetime FeatureDataType = "Datetime" + FeatureDataTypeDouble FeatureDataType = "Double" + FeatureDataTypeFloat FeatureDataType = "Float" + FeatureDataTypeInteger FeatureDataType = "Integer" + FeatureDataTypeLong FeatureDataType = "Long" + FeatureDataTypeString FeatureDataType = "String" +) + +// PossibleFeatureDataTypeValues returns the possible values for the FeatureDataType const type. +func PossibleFeatureDataTypeValues() []FeatureDataType { + return []FeatureDataType{ + FeatureDataTypeBinary, + FeatureDataTypeBoolean, + FeatureDataTypeDatetime, + FeatureDataTypeDouble, + FeatureDataTypeFloat, + FeatureDataTypeInteger, + FeatureDataTypeLong, + FeatureDataTypeString, + } +} + +// FeatureImportanceMode - The mode of operation for computing feature importance. +type FeatureImportanceMode string + +const ( + // FeatureImportanceModeDisabled - Disables computing feature importance within a signal. + FeatureImportanceModeDisabled FeatureImportanceMode = "Disabled" + // FeatureImportanceModeEnabled - Enables computing feature importance within a signal. + FeatureImportanceModeEnabled FeatureImportanceMode = "Enabled" +) + +// PossibleFeatureImportanceModeValues returns the possible values for the FeatureImportanceMode const type. +func PossibleFeatureImportanceModeValues() []FeatureImportanceMode { + return []FeatureImportanceMode{ + FeatureImportanceModeDisabled, + FeatureImportanceModeEnabled, + } +} + // FeatureLags - Flag for generating lags for the numeric features. type FeatureLags string @@ -898,7 +1402,7 @@ const ( // to missing data and shifts in the trend, and typically handles outliers well. ForecastingModelsProphet ForecastingModels = "Prophet" // ForecastingModelsRandomForest - 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. ForecastingModelsRandomForest ForecastingModels = "RandomForest" // ForecastingModelsSGD - SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning applications @@ -972,6 +1476,54 @@ func PossibleForecastingPrimaryMetricsValues() []ForecastingPrimaryMetrics { } } +// GenerationSafetyQualityMetric - Generation safety quality metric enum. +type GenerationSafetyQualityMetric string + +const ( + GenerationSafetyQualityMetricAcceptableCoherenceScorePerInstance GenerationSafetyQualityMetric = "AcceptableCoherenceScorePerInstance" + GenerationSafetyQualityMetricAcceptableFluencyScorePerInstance GenerationSafetyQualityMetric = "AcceptableFluencyScorePerInstance" + GenerationSafetyQualityMetricAcceptableGroundednessScorePerInstance GenerationSafetyQualityMetric = "AcceptableGroundednessScorePerInstance" + GenerationSafetyQualityMetricAcceptableRelevanceScorePerInstance GenerationSafetyQualityMetric = "AcceptableRelevanceScorePerInstance" + GenerationSafetyQualityMetricAcceptableSimilarityScorePerInstance GenerationSafetyQualityMetric = "AcceptableSimilarityScorePerInstance" + GenerationSafetyQualityMetricAggregatedCoherencePassRate GenerationSafetyQualityMetric = "AggregatedCoherencePassRate" + GenerationSafetyQualityMetricAggregatedFluencyPassRate GenerationSafetyQualityMetric = "AggregatedFluencyPassRate" + GenerationSafetyQualityMetricAggregatedGroundednessPassRate GenerationSafetyQualityMetric = "AggregatedGroundednessPassRate" + GenerationSafetyQualityMetricAggregatedRelevancePassRate GenerationSafetyQualityMetric = "AggregatedRelevancePassRate" + GenerationSafetyQualityMetricAggregatedSimilarityPassRate GenerationSafetyQualityMetric = "AggregatedSimilarityPassRate" +) + +// PossibleGenerationSafetyQualityMetricValues returns the possible values for the GenerationSafetyQualityMetric const type. +func PossibleGenerationSafetyQualityMetricValues() []GenerationSafetyQualityMetric { + return []GenerationSafetyQualityMetric{ + GenerationSafetyQualityMetricAcceptableCoherenceScorePerInstance, + GenerationSafetyQualityMetricAcceptableFluencyScorePerInstance, + GenerationSafetyQualityMetricAcceptableGroundednessScorePerInstance, + GenerationSafetyQualityMetricAcceptableRelevanceScorePerInstance, + GenerationSafetyQualityMetricAcceptableSimilarityScorePerInstance, + GenerationSafetyQualityMetricAggregatedCoherencePassRate, + GenerationSafetyQualityMetricAggregatedFluencyPassRate, + GenerationSafetyQualityMetricAggregatedGroundednessPassRate, + GenerationSafetyQualityMetricAggregatedRelevancePassRate, + GenerationSafetyQualityMetricAggregatedSimilarityPassRate, + } +} + +// GenerationTokenUsageMetric - Generation token statistics metric enum. +type GenerationTokenUsageMetric string + +const ( + GenerationTokenUsageMetricTotalTokenCount GenerationTokenUsageMetric = "TotalTokenCount" + GenerationTokenUsageMetricTotalTokenCountPerGroup GenerationTokenUsageMetric = "TotalTokenCountPerGroup" +) + +// PossibleGenerationTokenUsageMetricValues returns the possible values for the GenerationTokenUsageMetric const type. +func PossibleGenerationTokenUsageMetricValues() []GenerationTokenUsageMetric { + return []GenerationTokenUsageMetric{ + GenerationTokenUsageMetricTotalTokenCount, + GenerationTokenUsageMetricTotalTokenCountPerGroup, + } +} + // Goal - Defines supported metric goals for hyperparameter tuning type Goal string @@ -1006,6 +1558,77 @@ func PossibleIdentityConfigurationTypeValues() []IdentityConfigurationType { } } +// ImageAnnotationType - Annotation type of image data. +type ImageAnnotationType string + +const ( + ImageAnnotationTypeBoundingBox ImageAnnotationType = "BoundingBox" + ImageAnnotationTypeClassification ImageAnnotationType = "Classification" + ImageAnnotationTypeInstanceSegmentation ImageAnnotationType = "InstanceSegmentation" +) + +// PossibleImageAnnotationTypeValues returns the possible values for the ImageAnnotationType const type. +func PossibleImageAnnotationTypeValues() []ImageAnnotationType { + return []ImageAnnotationType{ + ImageAnnotationTypeBoundingBox, + ImageAnnotationTypeClassification, + ImageAnnotationTypeInstanceSegmentation, + } +} + +// ImageType - Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images +// (custom and curated) +type ImageType string + +const ( + ImageTypeAzureml ImageType = "azureml" + ImageTypeDocker ImageType = "docker" +) + +// PossibleImageTypeValues returns the possible values for the ImageType const type. +func PossibleImageTypeValues() []ImageType { + return []ImageType{ + ImageTypeAzureml, + ImageTypeDocker, + } +} + +// IncrementalDataRefresh - Whether IncrementalDataRefresh is enabled +type IncrementalDataRefresh string + +const ( + IncrementalDataRefreshDisabled IncrementalDataRefresh = "Disabled" + IncrementalDataRefreshEnabled IncrementalDataRefresh = "Enabled" +) + +// PossibleIncrementalDataRefreshValues returns the possible values for the IncrementalDataRefresh const type. +func PossibleIncrementalDataRefreshValues() []IncrementalDataRefresh { + return []IncrementalDataRefresh{ + IncrementalDataRefreshDisabled, + IncrementalDataRefreshEnabled, + } +} + +// InferencingServerType - Inferencing server type for various targets. +type InferencingServerType string + +const ( + InferencingServerTypeAzureMLBatch InferencingServerType = "AzureMLBatch" + InferencingServerTypeAzureMLOnline InferencingServerType = "AzureMLOnline" + InferencingServerTypeCustom InferencingServerType = "Custom" + InferencingServerTypeTriton InferencingServerType = "Triton" +) + +// PossibleInferencingServerTypeValues returns the possible values for the InferencingServerType const type. +func PossibleInferencingServerTypeValues() []InferencingServerType { + return []InferencingServerType{ + InferencingServerTypeAzureMLBatch, + InferencingServerTypeAzureMLOnline, + InferencingServerTypeCustom, + InferencingServerTypeTriton, + } +} + // InputDeliveryMode - Enum to determine the input data delivery mode. type InputDeliveryMode string @@ -1030,6 +1653,24 @@ func PossibleInputDeliveryModeValues() []InputDeliveryMode { } } +// InputPathType - Input path type for package inputs. +type InputPathType string + +const ( + InputPathTypePathID InputPathType = "PathId" + InputPathTypePathVersion InputPathType = "PathVersion" + InputPathTypeURL InputPathType = "Url" +) + +// PossibleInputPathTypeValues returns the possible values for the InputPathType const type. +func PossibleInputPathTypeValues() []InputPathType { + return []InputPathType{ + InputPathTypePathID, + InputPathTypePathVersion, + InputPathTypeURL, + } +} + // InstanceSegmentationPrimaryMetrics - Primary metrics for InstanceSegmentation tasks. type InstanceSegmentationPrimaryMetrics string @@ -1046,6 +1687,24 @@ func PossibleInstanceSegmentationPrimaryMetricsValues() []InstanceSegmentationPr } } +// IsolationMode - Isolation mode for the managed network of a machine learning workspace. +type IsolationMode string + +const ( + IsolationModeAllowInternetOutbound IsolationMode = "AllowInternetOutbound" + IsolationModeAllowOnlyApprovedOutbound IsolationMode = "AllowOnlyApprovedOutbound" + IsolationModeDisabled IsolationMode = "Disabled" +) + +// PossibleIsolationModeValues returns the possible values for the IsolationMode const type. +func PossibleIsolationModeValues() []IsolationMode { + return []IsolationMode{ + IsolationModeAllowInternetOutbound, + IsolationModeAllowOnlyApprovedOutbound, + IsolationModeDisabled, + } +} + // JobInputType - Enum to determine the Job Input Type. type JobInputType string @@ -1111,6 +1770,26 @@ func PossibleJobOutputTypeValues() []JobOutputType { } } +// JobProvisioningState - Enum to determine the job provisioning state. +type JobProvisioningState string + +const ( + JobProvisioningStateCanceled JobProvisioningState = "Canceled" + JobProvisioningStateFailed JobProvisioningState = "Failed" + JobProvisioningStateInProgress JobProvisioningState = "InProgress" + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" +) + +// PossibleJobProvisioningStateValues returns the possible values for the JobProvisioningState const type. +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return []JobProvisioningState{ + JobProvisioningStateCanceled, + JobProvisioningStateFailed, + JobProvisioningStateInProgress, + JobProvisioningStateSucceeded, + } +} + // JobStatus - The status of a job. type JobStatus string @@ -1144,6 +1823,8 @@ const ( JobStatusQueued JobStatus = "Queued" // JobStatusRunning - The job started to run in the compute target. JobStatusRunning JobStatus = "Running" + // JobStatusScheduled - The job is in a scheduled state. Job is not in any active state. + JobStatusScheduled JobStatus = "Scheduled" // JobStatusStarting - Run has started. The user has a run ID. JobStatusStarting JobStatus = "Starting" // JobStatusUnknown - Default job status if not mapped to all other statuses @@ -1165,18 +1846,43 @@ func PossibleJobStatusValues() []JobStatus { JobStatusProvisioning, JobStatusQueued, JobStatusRunning, + JobStatusScheduled, JobStatusStarting, JobStatusUnknown, } } +// JobTier - Enum to determine the job tier. +type JobTier string + +const ( + JobTierBasic JobTier = "Basic" + JobTierNull JobTier = "Null" + JobTierPremium JobTier = "Premium" + JobTierSpot JobTier = "Spot" + JobTierStandard JobTier = "Standard" +) + +// PossibleJobTierValues returns the possible values for the JobTier const type. +func PossibleJobTierValues() []JobTier { + return []JobTier{ + JobTierBasic, + JobTierNull, + JobTierPremium, + JobTierSpot, + JobTierStandard, + } +} + // JobType - Enum to determine the type of job. type JobType string const ( JobTypeAutoML JobType = "AutoML" JobTypeCommand JobType = "Command" + JobTypeLabeling JobType = "Labeling" JobTypePipeline JobType = "Pipeline" + JobTypeSpark JobType = "Spark" JobTypeSweep JobType = "Sweep" ) @@ -1185,7 +1891,9 @@ func PossibleJobTypeValues() []JobType { return []JobType{ JobTypeAutoML, JobTypeCommand, + JobTypeLabeling, JobTypePipeline, + JobTypeSpark, JobTypeSweep, } } @@ -1259,6 +1967,40 @@ func PossibleLoadBalancerTypeValues() []LoadBalancerType { } } +type LogTrainingMetrics string + +const ( + // LogTrainingMetricsDisable - Disable compute and log training metrics. + LogTrainingMetricsDisable LogTrainingMetrics = "Disable" + // LogTrainingMetricsEnable - Enable compute and log training metrics. + LogTrainingMetricsEnable LogTrainingMetrics = "Enable" +) + +// PossibleLogTrainingMetricsValues returns the possible values for the LogTrainingMetrics const type. +func PossibleLogTrainingMetricsValues() []LogTrainingMetrics { + return []LogTrainingMetrics{ + LogTrainingMetricsDisable, + LogTrainingMetricsEnable, + } +} + +type LogValidationLoss string + +const ( + // LogValidationLossDisable - Disable compute and log validation metrics. + LogValidationLossDisable LogValidationLoss = "Disable" + // LogValidationLossEnable - Enable compute and log validation metrics. + LogValidationLossEnable LogValidationLoss = "Enable" +) + +// PossibleLogValidationLossValues returns the possible values for the LogValidationLoss const type. +func PossibleLogValidationLossValues() []LogValidationLoss { + return []LogValidationLoss{ + LogValidationLossDisable, + LogValidationLossEnable, + } +} + // LogVerbosity - Enum for setting log verbosity. type LogVerbosity string @@ -1289,12 +2031,59 @@ func PossibleLogVerbosityValues() []LogVerbosity { } } -// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). -type ManagedServiceIdentityType string +type MLAssistConfigurationType string const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" - ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + MLAssistConfigurationTypeDisabled MLAssistConfigurationType = "Disabled" + MLAssistConfigurationTypeEnabled MLAssistConfigurationType = "Enabled" +) + +// PossibleMLAssistConfigurationTypeValues returns the possible values for the MLAssistConfigurationType const type. +func PossibleMLAssistConfigurationTypeValues() []MLAssistConfigurationType { + return []MLAssistConfigurationType{ + MLAssistConfigurationTypeDisabled, + MLAssistConfigurationTypeEnabled, + } +} + +// MLFlowAutologgerState - Enum to determine the state of mlflow autologger. +type MLFlowAutologgerState string + +const ( + MLFlowAutologgerStateDisabled MLFlowAutologgerState = "Disabled" + MLFlowAutologgerStateEnabled MLFlowAutologgerState = "Enabled" +) + +// PossibleMLFlowAutologgerStateValues returns the possible values for the MLFlowAutologgerState const type. +func PossibleMLFlowAutologgerStateValues() []MLFlowAutologgerState { + return []MLFlowAutologgerState{ + MLFlowAutologgerStateDisabled, + MLFlowAutologgerStateEnabled, + } +} + +// ManagedNetworkStatus - Status for the managed network of a machine learning workspace. +type ManagedNetworkStatus string + +const ( + ManagedNetworkStatusActive ManagedNetworkStatus = "Active" + ManagedNetworkStatusInactive ManagedNetworkStatus = "Inactive" +) + +// PossibleManagedNetworkStatusValues returns the possible values for the ManagedNetworkStatus const type. +func PossibleManagedNetworkStatusValues() []ManagedNetworkStatus { + return []ManagedNetworkStatus{ + ManagedNetworkStatusActive, + ManagedNetworkStatusInactive, + } +} + +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ) @@ -1309,6 +2098,57 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } +type MaterializationStoreType string + +const ( + MaterializationStoreTypeNone MaterializationStoreType = "None" + MaterializationStoreTypeOffline MaterializationStoreType = "Offline" + MaterializationStoreTypeOnline MaterializationStoreType = "Online" + MaterializationStoreTypeOnlineAndOffline MaterializationStoreType = "OnlineAndOffline" +) + +// PossibleMaterializationStoreTypeValues returns the possible values for the MaterializationStoreType const type. +func PossibleMaterializationStoreTypeValues() []MaterializationStoreType { + return []MaterializationStoreType{ + MaterializationStoreTypeNone, + MaterializationStoreTypeOffline, + MaterializationStoreTypeOnline, + MaterializationStoreTypeOnlineAndOffline, + } +} + +// MediaType - Media type of data asset. +type MediaType string + +const ( + MediaTypeImage MediaType = "Image" + MediaTypeText MediaType = "Text" +) + +// PossibleMediaTypeValues returns the possible values for the MediaType const type. +func PossibleMediaTypeValues() []MediaType { + return []MediaType{ + MediaTypeImage, + MediaTypeText, + } +} + +// MlflowAutologger - Indicates whether mlflow autologger is enabled for notebooks. +type MlflowAutologger string + +const ( + MlflowAutologgerDisabled MlflowAutologger = "Disabled" + MlflowAutologgerEnabled MlflowAutologger = "Enabled" +) + +// PossibleMlflowAutologgerValues returns the possible values for the MlflowAutologger const type. +func PossibleMlflowAutologgerValues() []MlflowAutologger { + return []MlflowAutologger{ + MlflowAutologgerDisabled, + MlflowAutologgerEnabled, + } +} + // ModelSize - Image model size. type ModelSize string @@ -1336,6 +2176,188 @@ func PossibleModelSizeValues() []ModelSize { } } +// ModelTaskType - Model task type enum. +type ModelTaskType string + +const ( + ModelTaskTypeClassification ModelTaskType = "Classification" + ModelTaskTypeQuestionAnswering ModelTaskType = "QuestionAnswering" + ModelTaskTypeRegression ModelTaskType = "Regression" +) + +// PossibleModelTaskTypeValues returns the possible values for the ModelTaskType const type. +func PossibleModelTaskTypeValues() []ModelTaskType { + return []ModelTaskType{ + ModelTaskTypeClassification, + ModelTaskTypeQuestionAnswering, + ModelTaskTypeRegression, + } +} + +// MonitorComputeIdentityType - Monitor compute identity type enum. +type MonitorComputeIdentityType string + +const ( + // MonitorComputeIdentityTypeAmlToken - Authenticates through user's AML token. + MonitorComputeIdentityTypeAmlToken MonitorComputeIdentityType = "AmlToken" + // MonitorComputeIdentityTypeManagedIdentity - Authenticates through a user-provided managed identity. + MonitorComputeIdentityTypeManagedIdentity MonitorComputeIdentityType = "ManagedIdentity" +) + +// PossibleMonitorComputeIdentityTypeValues returns the possible values for the MonitorComputeIdentityType const type. +func PossibleMonitorComputeIdentityTypeValues() []MonitorComputeIdentityType { + return []MonitorComputeIdentityType{ + MonitorComputeIdentityTypeAmlToken, + MonitorComputeIdentityTypeManagedIdentity, + } +} + +// MonitorComputeType - Monitor compute type enum. +type MonitorComputeType string + +const ( + // MonitorComputeTypeServerlessSpark - Serverless Spark compute. + MonitorComputeTypeServerlessSpark MonitorComputeType = "ServerlessSpark" +) + +// PossibleMonitorComputeTypeValues returns the possible values for the MonitorComputeType const type. +func PossibleMonitorComputeTypeValues() []MonitorComputeType { + return []MonitorComputeType{ + MonitorComputeTypeServerlessSpark, + } +} + +type MonitoringFeatureDataType string + +const ( + // MonitoringFeatureDataTypeCategorical - Used for features of categorical data type. + MonitoringFeatureDataTypeCategorical MonitoringFeatureDataType = "Categorical" + // MonitoringFeatureDataTypeNumerical - Used for features of numerical data type. + MonitoringFeatureDataTypeNumerical MonitoringFeatureDataType = "Numerical" +) + +// PossibleMonitoringFeatureDataTypeValues returns the possible values for the MonitoringFeatureDataType const type. +func PossibleMonitoringFeatureDataTypeValues() []MonitoringFeatureDataType { + return []MonitoringFeatureDataType{ + MonitoringFeatureDataTypeCategorical, + MonitoringFeatureDataTypeNumerical, + } +} + +type MonitoringFeatureFilterType string + +const ( + // MonitoringFeatureFilterTypeAllFeatures - Includes all features. + MonitoringFeatureFilterTypeAllFeatures MonitoringFeatureFilterType = "AllFeatures" + // MonitoringFeatureFilterTypeFeatureSubset - Includes a user-defined subset of features. + MonitoringFeatureFilterTypeFeatureSubset MonitoringFeatureFilterType = "FeatureSubset" + // MonitoringFeatureFilterTypeTopNByAttribution - Only includes the top contributing features, measured by feature attribution. + MonitoringFeatureFilterTypeTopNByAttribution MonitoringFeatureFilterType = "TopNByAttribution" +) + +// PossibleMonitoringFeatureFilterTypeValues returns the possible values for the MonitoringFeatureFilterType const type. +func PossibleMonitoringFeatureFilterTypeValues() []MonitoringFeatureFilterType { + return []MonitoringFeatureFilterType{ + MonitoringFeatureFilterTypeAllFeatures, + MonitoringFeatureFilterTypeFeatureSubset, + MonitoringFeatureFilterTypeTopNByAttribution, + } +} + +// MonitoringInputDataType - Monitoring input data type enum. +type MonitoringInputDataType string + +const ( + // MonitoringInputDataTypeFixed - An input data with tabular format which doesn't require preprocessing. + MonitoringInputDataTypeFixed MonitoringInputDataType = "Fixed" + // MonitoringInputDataTypeRolling - An input data which rolls relatively to the monitor's current run time. + MonitoringInputDataTypeRolling MonitoringInputDataType = "Rolling" + // MonitoringInputDataTypeStatic - An input data with a fixed window size. + MonitoringInputDataTypeStatic MonitoringInputDataType = "Static" +) + +// PossibleMonitoringInputDataTypeValues returns the possible values for the MonitoringInputDataType const type. +func PossibleMonitoringInputDataTypeValues() []MonitoringInputDataType { + return []MonitoringInputDataType{ + MonitoringInputDataTypeFixed, + MonitoringInputDataTypeRolling, + MonitoringInputDataTypeStatic, + } +} + +type MonitoringModelType string + +const ( + // MonitoringModelTypeClassification - A model trained for classification tasks. + MonitoringModelTypeClassification MonitoringModelType = "Classification" + // MonitoringModelTypeRegression - A model trained for regressions tasks. + MonitoringModelTypeRegression MonitoringModelType = "Regression" +) + +// PossibleMonitoringModelTypeValues returns the possible values for the MonitoringModelType const type. +func PossibleMonitoringModelTypeValues() []MonitoringModelType { + return []MonitoringModelType{ + MonitoringModelTypeClassification, + MonitoringModelTypeRegression, + } +} + +type MonitoringNotificationType string + +const ( + // MonitoringNotificationTypeAmlNotification - Enables email notifications through AML notifications. + MonitoringNotificationTypeAmlNotification MonitoringNotificationType = "AmlNotification" + // MonitoringNotificationTypeAzureMonitor - Enables notifications through Azure Monitor by posting metrics to the workspace's + // Azure Monitor instance. + MonitoringNotificationTypeAzureMonitor MonitoringNotificationType = "AzureMonitor" +) + +// PossibleMonitoringNotificationTypeValues returns the possible values for the MonitoringNotificationType const type. +func PossibleMonitoringNotificationTypeValues() []MonitoringNotificationType { + return []MonitoringNotificationType{ + MonitoringNotificationTypeAmlNotification, + MonitoringNotificationTypeAzureMonitor, + } +} + +type MonitoringSignalType string + +const ( + // MonitoringSignalTypeCustom - Tracks a custom signal provided by users. + MonitoringSignalTypeCustom MonitoringSignalType = "Custom" + // MonitoringSignalTypeDataDrift - Tracks model input data distribution change, comparing against training data or past production + // data. + MonitoringSignalTypeDataDrift MonitoringSignalType = "DataDrift" + // MonitoringSignalTypeDataQuality - Tracks model input data integrity. + MonitoringSignalTypeDataQuality MonitoringSignalType = "DataQuality" + // MonitoringSignalTypeFeatureAttributionDrift - Tracks feature importance change in production, comparing against feature + // importance at training time. + MonitoringSignalTypeFeatureAttributionDrift MonitoringSignalType = "FeatureAttributionDrift" + // MonitoringSignalTypeGenerationSafetyQuality - Tracks the safety and quality of generated content. + MonitoringSignalTypeGenerationSafetyQuality MonitoringSignalType = "GenerationSafetyQuality" + // MonitoringSignalTypeGenerationTokenStatistics - Tracks the token usage of generative endpoints. + MonitoringSignalTypeGenerationTokenStatistics MonitoringSignalType = "GenerationTokenStatistics" + // MonitoringSignalTypeModelPerformance - Tracks model performance based on ground truth data. + MonitoringSignalTypeModelPerformance MonitoringSignalType = "ModelPerformance" + // MonitoringSignalTypePredictionDrift - Tracks prediction result data distribution change, comparing against validation/test + // label data or past production data. + MonitoringSignalTypePredictionDrift MonitoringSignalType = "PredictionDrift" +) + +// PossibleMonitoringSignalTypeValues returns the possible values for the MonitoringSignalType const type. +func PossibleMonitoringSignalTypeValues() []MonitoringSignalType { + return []MonitoringSignalType{ + MonitoringSignalTypeCustom, + MonitoringSignalTypeDataDrift, + MonitoringSignalTypeDataQuality, + MonitoringSignalTypeFeatureAttributionDrift, + MonitoringSignalTypeGenerationSafetyQuality, + MonitoringSignalTypeGenerationTokenStatistics, + MonitoringSignalTypeModelPerformance, + MonitoringSignalTypePredictionDrift, + } +} + // MountAction - Mount Action. type MountAction string @@ -1376,6 +2398,22 @@ func PossibleMountStateValues() []MountState { } } +// MultiSelect - Whether multiSelect is enabled +type MultiSelect string + +const ( + MultiSelectDisabled MultiSelect = "Disabled" + MultiSelectEnabled MultiSelect = "Enabled" +) + +// PossibleMultiSelectValues returns the possible values for the MultiSelect const type. +func PossibleMultiSelectValues() []MultiSelect { + return []MultiSelect{ + MultiSelectDisabled, + MultiSelectEnabled, + } +} + // NCrossValidationsMode - Determines how N-Cross validations value is determined. type NCrossValidationsMode string @@ -1411,6 +2449,39 @@ func PossibleNetworkValues() []Network { } } +// NlpLearningRateScheduler - Enum of learning rate schedulers that aligns with those supported by HF +type NlpLearningRateScheduler string + +const ( + // NlpLearningRateSchedulerConstant - Constant learning rate. + NlpLearningRateSchedulerConstant NlpLearningRateScheduler = "Constant" + // NlpLearningRateSchedulerConstantWithWarmup - Linear warmup followed by constant value. + NlpLearningRateSchedulerConstantWithWarmup NlpLearningRateScheduler = "ConstantWithWarmup" + // NlpLearningRateSchedulerCosine - Linear warmup then cosine decay. + NlpLearningRateSchedulerCosine NlpLearningRateScheduler = "Cosine" + // NlpLearningRateSchedulerCosineWithRestarts - Linear warmup, cosine decay, then restart to initial LR. + NlpLearningRateSchedulerCosineWithRestarts NlpLearningRateScheduler = "CosineWithRestarts" + // NlpLearningRateSchedulerLinear - Linear warmup and decay. + NlpLearningRateSchedulerLinear NlpLearningRateScheduler = "Linear" + // NlpLearningRateSchedulerNone - No learning rate schedule. + NlpLearningRateSchedulerNone NlpLearningRateScheduler = "None" + // NlpLearningRateSchedulerPolynomial - Increase linearly then polynomially decay. + NlpLearningRateSchedulerPolynomial NlpLearningRateScheduler = "Polynomial" +) + +// PossibleNlpLearningRateSchedulerValues returns the possible values for the NlpLearningRateScheduler const type. +func PossibleNlpLearningRateSchedulerValues() []NlpLearningRateScheduler { + return []NlpLearningRateScheduler{ + NlpLearningRateSchedulerConstant, + NlpLearningRateSchedulerConstantWithWarmup, + NlpLearningRateSchedulerCosine, + NlpLearningRateSchedulerCosineWithRestarts, + NlpLearningRateSchedulerLinear, + NlpLearningRateSchedulerNone, + NlpLearningRateSchedulerPolynomial, + } +} + // NodeState - State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. type NodeState string @@ -1435,6 +2506,89 @@ func PossibleNodeStateValues() []NodeState { } } +// NodesValueType - The enumerated types for the nodes value +type NodesValueType string + +const ( + NodesValueTypeAll NodesValueType = "All" + NodesValueTypeCustom NodesValueType = "Custom" +) + +// PossibleNodesValueTypeValues returns the possible values for the NodesValueType const type. +func PossibleNodesValueTypeValues() []NodesValueType { + return []NodesValueType{ + NodesValueTypeAll, + NodesValueTypeCustom, + } +} + +type NumericalDataDriftMetric string + +const ( + // NumericalDataDriftMetricJensenShannonDistance - The Jensen Shannon Distance (JSD) metric. + NumericalDataDriftMetricJensenShannonDistance NumericalDataDriftMetric = "JensenShannonDistance" + // NumericalDataDriftMetricNormalizedWassersteinDistance - The Normalized Wasserstein Distance metric. + NumericalDataDriftMetricNormalizedWassersteinDistance NumericalDataDriftMetric = "NormalizedWassersteinDistance" + // NumericalDataDriftMetricPopulationStabilityIndex - The Population Stability Index (PSI) metric. + NumericalDataDriftMetricPopulationStabilityIndex NumericalDataDriftMetric = "PopulationStabilityIndex" + // NumericalDataDriftMetricTwoSampleKolmogorovSmirnovTest - The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) metric. + NumericalDataDriftMetricTwoSampleKolmogorovSmirnovTest NumericalDataDriftMetric = "TwoSampleKolmogorovSmirnovTest" +) + +// PossibleNumericalDataDriftMetricValues returns the possible values for the NumericalDataDriftMetric const type. +func PossibleNumericalDataDriftMetricValues() []NumericalDataDriftMetric { + return []NumericalDataDriftMetric{ + NumericalDataDriftMetricJensenShannonDistance, + NumericalDataDriftMetricNormalizedWassersteinDistance, + NumericalDataDriftMetricPopulationStabilityIndex, + NumericalDataDriftMetricTwoSampleKolmogorovSmirnovTest, + } +} + +type NumericalDataQualityMetric string + +const ( + // NumericalDataQualityMetricDataTypeErrorRate - Calculates the rate of data type errors. + NumericalDataQualityMetricDataTypeErrorRate NumericalDataQualityMetric = "DataTypeErrorRate" + // NumericalDataQualityMetricNullValueRate - Calculates the rate of null values. + NumericalDataQualityMetricNullValueRate NumericalDataQualityMetric = "NullValueRate" + // NumericalDataQualityMetricOutOfBoundsRate - Calculates the rate values are out of bounds. + NumericalDataQualityMetricOutOfBoundsRate NumericalDataQualityMetric = "OutOfBoundsRate" +) + +// PossibleNumericalDataQualityMetricValues returns the possible values for the NumericalDataQualityMetric const type. +func PossibleNumericalDataQualityMetricValues() []NumericalDataQualityMetric { + return []NumericalDataQualityMetric{ + NumericalDataQualityMetricDataTypeErrorRate, + NumericalDataQualityMetricNullValueRate, + NumericalDataQualityMetricOutOfBoundsRate, + } +} + +type NumericalPredictionDriftMetric string + +const ( + // NumericalPredictionDriftMetricJensenShannonDistance - The Jensen Shannon Distance (JSD) metric. + NumericalPredictionDriftMetricJensenShannonDistance NumericalPredictionDriftMetric = "JensenShannonDistance" + // NumericalPredictionDriftMetricNormalizedWassersteinDistance - The Normalized Wasserstein Distance metric. + NumericalPredictionDriftMetricNormalizedWassersteinDistance NumericalPredictionDriftMetric = "NormalizedWassersteinDistance" + // NumericalPredictionDriftMetricPopulationStabilityIndex - The Population Stability Index (PSI) metric. + NumericalPredictionDriftMetricPopulationStabilityIndex NumericalPredictionDriftMetric = "PopulationStabilityIndex" + // NumericalPredictionDriftMetricTwoSampleKolmogorovSmirnovTest - The Two Sample Kolmogorov-Smirnov Test (two-sample K–S) + // metric. + NumericalPredictionDriftMetricTwoSampleKolmogorovSmirnovTest NumericalPredictionDriftMetric = "TwoSampleKolmogorovSmirnovTest" +) + +// PossibleNumericalPredictionDriftMetricValues returns the possible values for the NumericalPredictionDriftMetric const type. +func PossibleNumericalPredictionDriftMetricValues() []NumericalPredictionDriftMetric { + return []NumericalPredictionDriftMetric{ + NumericalPredictionDriftMetricJensenShannonDistance, + NumericalPredictionDriftMetricNormalizedWassersteinDistance, + NumericalPredictionDriftMetricPopulationStabilityIndex, + NumericalPredictionDriftMetricTwoSampleKolmogorovSmirnovTest, + } +} + // ObjectDetectionPrimaryMetrics - Primary metrics for Image ObjectDetection task. type ObjectDetectionPrimaryMetrics string @@ -1451,6 +2605,20 @@ func PossibleObjectDetectionPrimaryMetricsValues() []ObjectDetectionPrimaryMetri } } +// OneLakeArtifactType - Enum to determine OneLake artifact type. +type OneLakeArtifactType string + +const ( + OneLakeArtifactTypeLakeHouse OneLakeArtifactType = "LakeHouse" +) + +// PossibleOneLakeArtifactTypeValues returns the possible values for the OneLakeArtifactType const type. +func PossibleOneLakeArtifactTypeValues() []OneLakeArtifactType { + return []OneLakeArtifactType{ + OneLakeArtifactTypeLakeHouse, + } +} + // OperatingSystemType - The type of operating system. type OperatingSystemType string @@ -1474,6 +2642,7 @@ const ( OperationNameCreate OperationName = "Create" OperationNameDelete OperationName = "Delete" OperationNameReimage OperationName = "Reimage" + OperationNameResize OperationName = "Resize" OperationNameRestart OperationName = "Restart" OperationNameStart OperationName = "Start" OperationNameStop OperationName = "Stop" @@ -1485,6 +2654,7 @@ func PossibleOperationNameValues() []OperationName { OperationNameCreate, OperationNameDelete, OperationNameReimage, + OperationNameResize, OperationNameRestart, OperationNameStart, OperationNameStop, @@ -1499,6 +2669,7 @@ const ( OperationStatusDeleteFailed OperationStatus = "DeleteFailed" OperationStatusInProgress OperationStatus = "InProgress" OperationStatusReimageFailed OperationStatus = "ReimageFailed" + OperationStatusResizeFailed OperationStatus = "ResizeFailed" OperationStatusRestartFailed OperationStatus = "RestartFailed" OperationStatusStartFailed OperationStatus = "StartFailed" OperationStatusStopFailed OperationStatus = "StopFailed" @@ -1512,6 +2683,7 @@ func PossibleOperationStatusValues() []OperationStatus { OperationStatusDeleteFailed, OperationStatusInProgress, OperationStatusReimageFailed, + OperationStatusResizeFailed, OperationStatusRestartFailed, OperationStatusStartFailed, OperationStatusStopFailed, @@ -1556,6 +2728,25 @@ func PossibleOrderStringValues() []OrderString { } } +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + // OsType - Compute OS Type type OsType string @@ -1576,6 +2767,7 @@ func PossibleOsTypeValues() []OsType { type OutputDeliveryMode string const ( + OutputDeliveryModeDirect OutputDeliveryMode = "Direct" OutputDeliveryModeReadWriteMount OutputDeliveryMode = "ReadWriteMount" OutputDeliveryModeUpload OutputDeliveryMode = "Upload" ) @@ -1583,11 +2775,140 @@ const ( // PossibleOutputDeliveryModeValues returns the possible values for the OutputDeliveryMode const type. func PossibleOutputDeliveryModeValues() []OutputDeliveryMode { return []OutputDeliveryMode{ + OutputDeliveryModeDirect, OutputDeliveryModeReadWriteMount, OutputDeliveryModeUpload, } } +// PackageBuildState - Package build state returned in package response. +type PackageBuildState string + +const ( + PackageBuildStateFailed PackageBuildState = "Failed" + PackageBuildStateNotStarted PackageBuildState = "NotStarted" + PackageBuildStateRunning PackageBuildState = "Running" + PackageBuildStateSucceeded PackageBuildState = "Succeeded" +) + +// PossiblePackageBuildStateValues returns the possible values for the PackageBuildState const type. +func PossiblePackageBuildStateValues() []PackageBuildState { + return []PackageBuildState{ + PackageBuildStateFailed, + PackageBuildStateNotStarted, + PackageBuildStateRunning, + PackageBuildStateSucceeded, + } +} + +// PackageInputDeliveryMode - Mounting type of the model or the inputs +type PackageInputDeliveryMode string + +const ( + PackageInputDeliveryModeCopy PackageInputDeliveryMode = "Copy" + PackageInputDeliveryModeDownload PackageInputDeliveryMode = "Download" +) + +// PossiblePackageInputDeliveryModeValues returns the possible values for the PackageInputDeliveryMode const type. +func PossiblePackageInputDeliveryModeValues() []PackageInputDeliveryMode { + return []PackageInputDeliveryMode{ + PackageInputDeliveryModeCopy, + PackageInputDeliveryModeDownload, + } +} + +// PackageInputType - Type of the inputs. +type PackageInputType string + +const ( + PackageInputTypeURIFile PackageInputType = "UriFile" + PackageInputTypeURIFolder PackageInputType = "UriFolder" +) + +// PossiblePackageInputTypeValues returns the possible values for the PackageInputType const type. +func PossiblePackageInputTypeValues() []PackageInputType { + return []PackageInputType{ + PackageInputTypeURIFile, + PackageInputTypeURIFolder, + } +} + +// PatchStatus - The os patching status. +type PatchStatus string + +const ( + PatchStatusCompletedWithWarnings PatchStatus = "CompletedWithWarnings" + PatchStatusFailed PatchStatus = "Failed" + PatchStatusInProgress PatchStatus = "InProgress" + PatchStatusSucceeded PatchStatus = "Succeeded" + PatchStatusUnknown PatchStatus = "Unknown" +) + +// PossiblePatchStatusValues returns the possible values for the PatchStatus const type. +func PossiblePatchStatusValues() []PatchStatus { + return []PatchStatus{ + PatchStatusCompletedWithWarnings, + PatchStatusFailed, + PatchStatusInProgress, + PatchStatusSucceeded, + PatchStatusUnknown, + } +} + +// PendingUploadCredentialType - Enum to determine the PendingUpload credentials type. +type PendingUploadCredentialType string + +const ( + PendingUploadCredentialTypeSAS PendingUploadCredentialType = "SAS" +) + +// PossiblePendingUploadCredentialTypeValues returns the possible values for the PendingUploadCredentialType const type. +func PossiblePendingUploadCredentialTypeValues() []PendingUploadCredentialType { + return []PendingUploadCredentialType{ + PendingUploadCredentialTypeSAS, + } +} + +// PendingUploadType - Type of storage to use for the pending upload location +type PendingUploadType string + +const ( + PendingUploadTypeNone PendingUploadType = "None" + PendingUploadTypeTemporaryBlobReference PendingUploadType = "TemporaryBlobReference" +) + +// PossiblePendingUploadTypeValues returns the possible values for the PendingUploadType const type. +func PossiblePendingUploadTypeValues() []PendingUploadType { + return []PendingUploadType{ + PendingUploadTypeNone, + PendingUploadTypeTemporaryBlobReference, + } +} + +// PoolProvisioningState - State of pool related resources provisioning. +type PoolProvisioningState string + +const ( + PoolProvisioningStateCanceled PoolProvisioningState = "Canceled" + PoolProvisioningStateCreating PoolProvisioningState = "Creating" + PoolProvisioningStateDeleting PoolProvisioningState = "Deleting" + PoolProvisioningStateFailed PoolProvisioningState = "Failed" + PoolProvisioningStateSucceeded PoolProvisioningState = "Succeeded" + PoolProvisioningStateUpdating PoolProvisioningState = "Updating" +) + +// PossiblePoolProvisioningStateValues returns the possible values for the PoolProvisioningState const type. +func PossiblePoolProvisioningStateValues() []PoolProvisioningState { + return []PoolProvisioningState{ + PoolProvisioningStateCanceled, + PoolProvisioningStateCreating, + PoolProvisioningStateDeleting, + PoolProvisioningStateFailed, + PoolProvisioningStateSucceeded, + PoolProvisioningStateUpdating, + } +} + // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -1608,30 +2929,44 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin } } -// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. -type PrivateEndpointServiceConnectionStatus string +// ProtectionLevel - Protection level associated with the Intellectual Property. +type ProtectionLevel string + +const ( + // ProtectionLevelAll - All means Intellectual Property is fully protected. + ProtectionLevelAll ProtectionLevel = "All" + // ProtectionLevelNone - None means it is not an Intellectual Property. + ProtectionLevelNone ProtectionLevel = "None" +) + +// PossibleProtectionLevelValues returns the possible values for the ProtectionLevel const type. +func PossibleProtectionLevelValues() []ProtectionLevel { + return []ProtectionLevel{ + ProtectionLevelAll, + ProtectionLevelNone, + } +} + +// Protocol - Protocol over which communication will happen over this endpoint +type Protocol string const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" - PrivateEndpointServiceConnectionStatusTimeout PrivateEndpointServiceConnectionStatus = "Timeout" + ProtocolHTTP Protocol = "http" + ProtocolTCP Protocol = "tcp" + ProtocolUDP Protocol = "udp" ) -// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{ - PrivateEndpointServiceConnectionStatusApproved, - PrivateEndpointServiceConnectionStatusDisconnected, - PrivateEndpointServiceConnectionStatusPending, - PrivateEndpointServiceConnectionStatusRejected, - PrivateEndpointServiceConnectionStatusTimeout, +// PossibleProtocolValues returns the possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ + ProtocolHTTP, + ProtocolTCP, + ProtocolUDP, } } -// ProvisioningState - The current deployment state of workspace resource. The provisioningState is to indicate states for -// resource provisioning. +// ProvisioningState - The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and +// Failed. type ProvisioningState string const ( @@ -1675,22 +3010,6 @@ func PossibleProvisioningStatusValues() []ProvisioningStatus { } } -// PublicNetworkAccess - Whether requests from Public Network are allowed. -type PublicNetworkAccess string - -const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{ - PublicNetworkAccessDisabled, - PublicNetworkAccessEnabled, - } -} - // PublicNetworkAccessType - Enum to determine whether PublicNetworkAccess is Enabled or Disabled. type PublicNetworkAccessType string @@ -1782,6 +3101,26 @@ func PossibleReferenceTypeValues() []ReferenceType { } } +type RegressionModelPerformanceMetric string + +const ( + // RegressionModelPerformanceMetricMeanAbsoluteError - The Mean Absolute Error (MAE) metric. + RegressionModelPerformanceMetricMeanAbsoluteError RegressionModelPerformanceMetric = "MeanAbsoluteError" + // RegressionModelPerformanceMetricMeanSquaredError - The Mean Squared Error (MSE) metric. + RegressionModelPerformanceMetricMeanSquaredError RegressionModelPerformanceMetric = "MeanSquaredError" + // RegressionModelPerformanceMetricRootMeanSquaredError - The Root Mean Squared Error (RMSE) metric. + RegressionModelPerformanceMetricRootMeanSquaredError RegressionModelPerformanceMetric = "RootMeanSquaredError" +) + +// PossibleRegressionModelPerformanceMetricValues returns the possible values for the RegressionModelPerformanceMetric const type. +func PossibleRegressionModelPerformanceMetricValues() []RegressionModelPerformanceMetric { + return []RegressionModelPerformanceMetric{ + RegressionModelPerformanceMetricMeanAbsoluteError, + RegressionModelPerformanceMetricMeanSquaredError, + RegressionModelPerformanceMetricRootMeanSquaredError, + } +} + // RegressionModels - Enum for all Regression models supported by AutoML. type RegressionModels string @@ -1810,7 +3149,7 @@ const ( // RegressionModelsLightGBM - LightGBM is a gradient boosting framework that uses tree based learning algorithms. RegressionModelsLightGBM RegressionModels = "LightGBM" // RegressionModelsRandomForest - 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. RegressionModelsRandomForest RegressionModels = "RandomForest" // RegressionModelsSGD - SGD: Stochastic gradient descent is an optimization algorithm often used in machine learning applications @@ -1888,6 +3227,95 @@ func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { } } +type RollingRateType string + +const ( + RollingRateTypeDay RollingRateType = "Day" + RollingRateTypeHour RollingRateType = "Hour" + RollingRateTypeMinute RollingRateType = "Minute" + RollingRateTypeMonth RollingRateType = "Month" + RollingRateTypeYear RollingRateType = "Year" +) + +// PossibleRollingRateTypeValues returns the possible values for the RollingRateType const type. +func PossibleRollingRateTypeValues() []RollingRateType { + return []RollingRateType{ + RollingRateTypeDay, + RollingRateTypeHour, + RollingRateTypeMinute, + RollingRateTypeMonth, + RollingRateTypeYear, + } +} + +// RuleAction - The action enum for networking rule. +type RuleAction string + +const ( + RuleActionAllow RuleAction = "Allow" + RuleActionDeny RuleAction = "Deny" +) + +// PossibleRuleActionValues returns the possible values for the RuleAction const type. +func PossibleRuleActionValues() []RuleAction { + return []RuleAction{ + RuleActionAllow, + RuleActionDeny, + } +} + +// RuleCategory - Category of a managed network Outbound Rule of a machine learning workspace. +type RuleCategory string + +const ( + RuleCategoryRecommended RuleCategory = "Recommended" + RuleCategoryRequired RuleCategory = "Required" + RuleCategoryUserDefined RuleCategory = "UserDefined" +) + +// PossibleRuleCategoryValues returns the possible values for the RuleCategory const type. +func PossibleRuleCategoryValues() []RuleCategory { + return []RuleCategory{ + RuleCategoryRecommended, + RuleCategoryRequired, + RuleCategoryUserDefined, + } +} + +// RuleStatus - Type of a managed network Outbound Rule of a machine learning workspace. +type RuleStatus string + +const ( + RuleStatusActive RuleStatus = "Active" + RuleStatusInactive RuleStatus = "Inactive" +) + +// PossibleRuleStatusValues returns the possible values for the RuleStatus const type. +func PossibleRuleStatusValues() []RuleStatus { + return []RuleStatus{ + RuleStatusActive, + RuleStatusInactive, + } +} + +// RuleType - Type of a managed network Outbound Rule of a machine learning workspace. +type RuleType string + +const ( + RuleTypeFQDN RuleType = "FQDN" + RuleTypePrivateEndpoint RuleType = "PrivateEndpoint" + RuleTypeServiceTag RuleType = "ServiceTag" +) + +// PossibleRuleTypeValues returns the possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{ + RuleTypeFQDN, + RuleTypePrivateEndpoint, + RuleTypeServiceTag, + } +} + // SKUScaleType - Node scaling setting for the compute sku. type SKUScaleType string @@ -1914,19 +3342,19 @@ func PossibleSKUScaleTypeValues() []SKUScaleType { type SKUTier string const ( - SKUTierFree SKUTier = "Free" SKUTierBasic SKUTier = "Basic" - SKUTierStandard SKUTier = "Standard" + SKUTierFree SKUTier = "Free" SKUTierPremium SKUTier = "Premium" + SKUTierStandard SKUTier = "Standard" ) // PossibleSKUTierValues returns the possible values for the SKUTier const type. func PossibleSKUTierValues() []SKUTier { return []SKUTier{ - SKUTierFree, SKUTierBasic, - SKUTierStandard, + SKUTierFree, SKUTierPremium, + SKUTierStandard, } } @@ -2002,6 +3430,8 @@ type ScheduleActionType string const ( ScheduleActionTypeCreateJob ScheduleActionType = "CreateJob" + ScheduleActionTypeCreateMonitor ScheduleActionType = "CreateMonitor" + ScheduleActionTypeImportData ScheduleActionType = "ImportData" ScheduleActionTypeInvokeBatchEndpoint ScheduleActionType = "InvokeBatchEndpoint" ) @@ -2009,6 +3439,8 @@ const ( func PossibleScheduleActionTypeValues() []ScheduleActionType { return []ScheduleActionType{ ScheduleActionTypeCreateJob, + ScheduleActionTypeCreateMonitor, + ScheduleActionTypeImportData, ScheduleActionTypeInvokeBatchEndpoint, } } @@ -2111,6 +3543,8 @@ type SecretsType string const ( SecretsTypeAccountKey SecretsType = "AccountKey" SecretsTypeCertificate SecretsType = "Certificate" + SecretsTypeKerberosKeytab SecretsType = "KerberosKeytab" + SecretsTypeKerberosPassword SecretsType = "KerberosPassword" SecretsTypeSas SecretsType = "Sas" SecretsTypeServicePrincipal SecretsType = "ServicePrincipal" ) @@ -2120,11 +3554,28 @@ func PossibleSecretsTypeValues() []SecretsType { return []SecretsType{ SecretsTypeAccountKey, SecretsTypeCertificate, + SecretsTypeKerberosKeytab, + SecretsTypeKerberosPassword, SecretsTypeSas, SecretsTypeServicePrincipal, } } +type ServerlessInferenceEndpointAuthMode string + +const ( + ServerlessInferenceEndpointAuthModeAAD ServerlessInferenceEndpointAuthMode = "AAD" + ServerlessInferenceEndpointAuthModeKey ServerlessInferenceEndpointAuthMode = "Key" +) + +// PossibleServerlessInferenceEndpointAuthModeValues returns the possible values for the ServerlessInferenceEndpointAuthMode const type. +func PossibleServerlessInferenceEndpointAuthModeValues() []ServerlessInferenceEndpointAuthMode { + return []ServerlessInferenceEndpointAuthMode{ + ServerlessInferenceEndpointAuthModeAAD, + ServerlessInferenceEndpointAuthModeKey, + } +} + type ServiceDataAccessAuthIdentity string const ( @@ -2190,6 +3641,21 @@ func PossibleSourceTypeValues() []SourceType { } } +type SparkJobEntryType string + +const ( + SparkJobEntryTypeSparkJobPythonEntry SparkJobEntryType = "SparkJobPythonEntry" + SparkJobEntryTypeSparkJobScalaEntry SparkJobEntryType = "SparkJobScalaEntry" +) + +// PossibleSparkJobEntryTypeValues returns the possible values for the SparkJobEntryType const type. +func PossibleSparkJobEntryTypeValues() []SparkJobEntryType { + return []SparkJobEntryType{ + SparkJobEntryTypeSparkJobPythonEntry, + SparkJobEntryTypeSparkJobScalaEntry, + } +} + // StackMetaLearnerType - The meta-learner is a model trained on the output of the individual heterogeneous models. Default // meta-learners are LogisticRegression for classification tasks (or LogisticRegressionCV if // cross-validation is enabled) and ElasticNet for regression/forecasting tasks (or ElasticNetCV if cross-validation is enabled). @@ -2255,6 +3721,23 @@ func PossibleStatusValues() []Status { } } +type StatusMessageLevel string + +const ( + StatusMessageLevelError StatusMessageLevel = "Error" + StatusMessageLevelInformation StatusMessageLevel = "Information" + StatusMessageLevelWarning StatusMessageLevel = "Warning" +) + +// PossibleStatusMessageLevelValues returns the possible values for the StatusMessageLevel const type. +func PossibleStatusMessageLevelValues() []StatusMessageLevel { + return []StatusMessageLevel{ + StatusMessageLevelError, + StatusMessageLevelInformation, + StatusMessageLevelWarning, + } +} + // StochasticOptimizer - Stochastic optimizer for image models. type StochasticOptimizer string @@ -2414,6 +3897,43 @@ func PossibleTaskTypeValues() []TaskType { } } +// TextAnnotationType - Annotation type of text data. +type TextAnnotationType string + +const ( + TextAnnotationTypeClassification TextAnnotationType = "Classification" + TextAnnotationTypeNamedEntityRecognition TextAnnotationType = "NamedEntityRecognition" +) + +// PossibleTextAnnotationTypeValues returns the possible values for the TextAnnotationType const type. +func PossibleTextAnnotationTypeValues() []TextAnnotationType { + return []TextAnnotationType{ + TextAnnotationTypeClassification, + TextAnnotationTypeNamedEntityRecognition, + } +} + +// TrainingMode - Training mode dictates whether to use distributed training or not +type TrainingMode string + +const ( + // TrainingModeAuto - Auto mode + TrainingModeAuto TrainingMode = "Auto" + // TrainingModeDistributed - Distributed training mode + TrainingModeDistributed TrainingMode = "Distributed" + // TrainingModeNonDistributed - Non distributed training mode + TrainingModeNonDistributed TrainingMode = "NonDistributed" +) + +// PossibleTrainingModeValues returns the possible values for the TrainingMode const type. +func PossibleTrainingModeValues() []TrainingMode { + return []TrainingMode{ + TrainingModeAuto, + TrainingModeDistributed, + TrainingModeNonDistributed, + } +} + type TriggerType string const ( @@ -2565,17 +4085,37 @@ func PossibleValidationMetricTypeValues() []ValidationMetricType { } } -// ValueFormat - format for the workspace connection value -type ValueFormat string +// VolumeDefinitionType - Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe +type VolumeDefinitionType string + +const ( + VolumeDefinitionTypeBind VolumeDefinitionType = "bind" + VolumeDefinitionTypeNpipe VolumeDefinitionType = "npipe" + VolumeDefinitionTypeTmpfs VolumeDefinitionType = "tmpfs" + VolumeDefinitionTypeVolume VolumeDefinitionType = "volume" +) + +// PossibleVolumeDefinitionTypeValues returns the possible values for the VolumeDefinitionType const type. +func PossibleVolumeDefinitionTypeValues() []VolumeDefinitionType { + return []VolumeDefinitionType{ + VolumeDefinitionTypeBind, + VolumeDefinitionTypeNpipe, + VolumeDefinitionTypeTmpfs, + VolumeDefinitionTypeVolume, + } +} + +// WebhookType - Enum to determine the webhook callback service type. +type WebhookType string const ( - ValueFormatJSON ValueFormat = "JSON" + WebhookTypeAzureDevOps WebhookType = "AzureDevOps" ) -// PossibleValueFormatValues returns the possible values for the ValueFormat const type. -func PossibleValueFormatValues() []ValueFormat { - return []ValueFormat{ - ValueFormatJSON, +// PossibleWebhookTypeValues returns the possible values for the WebhookType const type. +func PossibleWebhookTypeValues() []WebhookType { + return []WebhookType{ + WebhookTypeAzureDevOps, } } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go index ef6431306899..e717dca94b61 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type DataContainersClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDataContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataContainersClient, error) { - cl, err := arm.NewClient(moduleName+".DataContainersClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,7 +46,7 @@ func NewDataContainersClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or update container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -55,18 +54,25 @@ func NewDataContainersClient(subscriptionID string, credential azcore.TokenCrede // - options - DataContainersClientCreateOrUpdateOptions contains the optional parameters for the DataContainersClient.CreateOrUpdate // method. func (client *DataContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body DataContainer, options *DataContainersClientCreateOrUpdateOptions) (DataContainersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "DataContainersClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return DataContainersClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataContainersClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DataContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DataContainersClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -93,10 +99,13 @@ func (client *DataContainersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -111,22 +120,28 @@ func (client *DataContainersClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - options - DataContainersClientDeleteOptions contains the optional parameters for the DataContainersClient.Delete method. func (client *DataContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataContainersClientDeleteOptions) (DataContainersClientDeleteResponse, error) { + var err error + const operationName = "DataContainersClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return DataContainersClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataContainersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DataContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DataContainersClientDeleteResponse{}, err } return DataContainersClientDeleteResponse{}, nil } @@ -155,7 +170,7 @@ func (client *DataContainersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,24 +179,31 @@ func (client *DataContainersClient) deleteCreateRequest(ctx context.Context, res // Get - Get container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - options - DataContainersClientGetOptions contains the optional parameters for the DataContainersClient.Get method. func (client *DataContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DataContainersClientGetOptions) (DataContainersClientGetResponse, error) { + var err error + const operationName = "DataContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return DataContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DataContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -208,7 +230,7 @@ func (client *DataContainersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +247,7 @@ func (client *DataContainersClient) getHandleResponse(resp *http.Response) (Data // NewListPager - List data containers. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - DataContainersClientListOptions contains the optional parameters for the DataContainersClient.NewListPager method. @@ -235,25 +257,20 @@ func (client *DataContainersClient) NewListPager(resourceGroupName string, works return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *DataContainersClientListResponse) (DataContainersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DataContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return DataContainersClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DataContainersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataContainersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -277,7 +294,7 @@ func (client *DataContainersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client_example_test.go deleted file mode 100644 index 92aa8b6126b6..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client_example_test.go +++ /dev/null @@ -1,219 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/list.json -func ExampleDataContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataContainersClient().NewListPager("testrg123", "workspace123", &armmachinelearning.DataContainersClientListOptions{Skip: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataContainerResourceArmPaginatedResult = armmachinelearning.DataContainerResourceArmPaginatedResult{ - // Value: []*armmachinelearning.DataContainer{ - // { - // Name: to.Ptr("datastore123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/data"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/data/datacontainer123"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.DataContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "properties1": to.Ptr("value1"), - // "properties2": to.Ptr("value2"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // DataType: to.Ptr(armmachinelearning.DataType("UriFile")), - // }, - // }, - // { - // Name: to.Ptr("datastore124"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/data"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/data/datacontainer124"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.DataContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "properties1": to.Ptr("value1"), - // "properties2": to.Ptr("value2"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // DataType: to.Ptr(armmachinelearning.DataType("UriFile")), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/delete.json -func ExampleDataContainersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataContainersClient().Delete(ctx, "testrg123", "workspace123", "datacontainer123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/get.json -func ExampleDataContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataContainersClient().Get(ctx, "testrg123", "workspace123", "datacontainer123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataContainer = armmachinelearning.DataContainer{ - // Name: to.Ptr("datacontainer123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/data"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/data/datacontainer123"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.DataContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "properties1": to.Ptr("value1"), - // "properties2": to.Ptr("value2"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // DataType: to.Ptr(armmachinelearning.DataType("UriFile")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataContainer/createOrUpdate.json -func ExampleDataContainersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataContainersClient().CreateOrUpdate(ctx, "testrg123", "workspace123", "datacontainer123", armmachinelearning.DataContainer{ - Properties: &armmachinelearning.DataContainerProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "properties1": to.Ptr("value1"), - "properties2": to.Ptr("value2"), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - DataType: to.Ptr(armmachinelearning.DataType("UriFile")), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataContainer = armmachinelearning.DataContainer{ - // Name: to.Ptr("datacontainer123"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/data"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/data/datacontainer123"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.DataContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "properties1": to.Ptr("value1"), - // "properties2": to.Ptr("value2"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // DataType: to.Ptr(armmachinelearning.DataType("UriFile")), - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client.go index 5ccc88087d0c..a32fd382106c 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type DatastoresClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDatastoresClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatastoresClient, error) { - cl, err := arm.NewClient(moduleName+".DatastoresClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewDatastoresClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Create or update datastore. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. @@ -56,18 +55,25 @@ func NewDatastoresClient(subscriptionID string, credential azcore.TokenCredentia // - options - DatastoresClientCreateOrUpdateOptions contains the optional parameters for the DatastoresClient.CreateOrUpdate // method. func (client *DatastoresClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body Datastore, options *DatastoresClientCreateOrUpdateOptions) (DatastoresClientCreateOrUpdateResponse, error) { + var err error + const operationName = "DatastoresClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return DatastoresClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatastoresClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DatastoresClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DatastoresClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +100,16 @@ func (client *DatastoresClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.SkipValidation != nil { reqQP.Set("skipValidation", strconv.FormatBool(*options.SkipValidation)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,22 +124,28 @@ func (client *DatastoresClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Delete datastore. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. // - options - DatastoresClientDeleteOptions contains the optional parameters for the DatastoresClient.Delete method. func (client *DatastoresClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientDeleteOptions) (DatastoresClientDeleteResponse, error) { + var err error + const operationName = "DatastoresClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return DatastoresClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatastoresClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DatastoresClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DatastoresClientDeleteResponse{}, err } return DatastoresClientDeleteResponse{}, nil } @@ -159,7 +174,7 @@ func (client *DatastoresClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,24 +183,31 @@ func (client *DatastoresClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get datastore. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. // - options - DatastoresClientGetOptions contains the optional parameters for the DatastoresClient.Get method. func (client *DatastoresClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientGetOptions) (DatastoresClientGetResponse, error) { + var err error + const operationName = "DatastoresClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return DatastoresClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatastoresClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatastoresClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatastoresClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -212,7 +234,7 @@ func (client *DatastoresClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,7 +251,7 @@ func (client *DatastoresClient) getHandleResponse(resp *http.Response) (Datastor // NewListPager - List datastores. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - DatastoresClientListOptions contains the optional parameters for the DatastoresClient.NewListPager method. @@ -239,25 +261,20 @@ func (client *DatastoresClient) NewListPager(resourceGroupName string, workspace return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *DatastoresClientListResponse) (DatastoresClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DatastoresClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return DatastoresClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DatastoresClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatastoresClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -281,7 +298,7 @@ func (client *DatastoresClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } @@ -320,24 +337,31 @@ func (client *DatastoresClient) listHandleResponse(resp *http.Response) (Datasto // ListSecrets - Get datastore secrets. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. // - options - DatastoresClientListSecretsOptions contains the optional parameters for the DatastoresClient.ListSecrets method. func (client *DatastoresClient) ListSecrets(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *DatastoresClientListSecretsOptions) (DatastoresClientListSecretsResponse, error) { + var err error + const operationName = "DatastoresClient.ListSecrets" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return DatastoresClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DatastoresClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatastoresClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DatastoresClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -364,7 +388,7 @@ func (client *DatastoresClient) listSecretsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client_example_test.go deleted file mode 100644 index 1a5a5f4758d6..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client_example_test.go +++ /dev/null @@ -1,449 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/list.json -func ExampleDatastoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatastoresClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.DatastoresClientListOptions{Skip: nil, - Count: to.Ptr[int32](1), - IsDefault: to.Ptr(false), - Names: []string{ - "string"}, - SearchText: to.Ptr("string"), - OrderBy: to.Ptr("string"), - OrderByAsc: to.Ptr(false), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatastoreResourceArmPaginatedResult = armmachinelearning.DatastoreResourceArmPaginatedResult{ - // Value: []*armmachinelearning.Datastore{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.AzureBlobDatastore{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Credentials: &armmachinelearning.AccountKeyDatastoreCredentials{ - // CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeAccountKey), - // }, - // DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureBlob), - // IsDefault: to.Ptr(false), - // AccountName: to.Ptr("string"), - // ContainerName: to.Ptr("string"), - // Endpoint: to.Ptr("core.windows.net"), - // Protocol: to.Ptr("https"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/delete.json -func ExampleDatastoresClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDatastoresClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/get.json -func ExampleDatastoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armmachinelearning.Datastore{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.AzureBlobDatastore{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Credentials: &armmachinelearning.AccountKeyDatastoreCredentials{ - // CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeAccountKey), - // }, - // DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureBlob), - // IsDefault: to.Ptr(false), - // AccountName: to.Ptr("string"), - // ContainerName: to.Ptr("string"), - // Endpoint: to.Ptr("core.windows.net"), - // Protocol: to.Ptr("https"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json -func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.Datastore{ - Properties: &armmachinelearning.AzureDataLakeGen1Datastore{ - Description: to.Ptr("string"), - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - Credentials: &armmachinelearning.ServicePrincipalDatastoreCredentials{ - CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeServicePrincipal), - AuthorityURL: to.Ptr("string"), - ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - ResourceURL: to.Ptr("string"), - Secrets: &armmachinelearning.ServicePrincipalDatastoreSecrets{ - SecretsType: to.Ptr(armmachinelearning.SecretsTypeServicePrincipal), - ClientSecret: to.Ptr("string"), - }, - TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - }, - DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureDataLakeGen1), - StoreName: to.Ptr("string"), - }, - }, &armmachinelearning.DatastoresClientCreateOrUpdateOptions{SkipValidation: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armmachinelearning.Datastore{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.AzureDataLakeGen1Datastore{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Credentials: &armmachinelearning.ServicePrincipalDatastoreCredentials{ - // CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeServicePrincipal), - // AuthorityURL: to.Ptr("string"), - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // ResourceURL: to.Ptr("string"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureDataLakeGen1), - // StoreName: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json -func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.Datastore{ - Properties: &armmachinelearning.AzureDataLakeGen2Datastore{ - Description: to.Ptr("string"), - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - Credentials: &armmachinelearning.ServicePrincipalDatastoreCredentials{ - CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeServicePrincipal), - AuthorityURL: to.Ptr("string"), - ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - ResourceURL: to.Ptr("string"), - Secrets: &armmachinelearning.ServicePrincipalDatastoreSecrets{ - SecretsType: to.Ptr(armmachinelearning.SecretsTypeServicePrincipal), - ClientSecret: to.Ptr("string"), - }, - TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - }, - DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureDataLakeGen2), - AccountName: to.Ptr("string"), - Endpoint: to.Ptr("string"), - Filesystem: to.Ptr("string"), - Protocol: to.Ptr("string"), - }, - }, &armmachinelearning.DatastoresClientCreateOrUpdateOptions{SkipValidation: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armmachinelearning.Datastore{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.AzureDataLakeGen2Datastore{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Credentials: &armmachinelearning.ServicePrincipalDatastoreCredentials{ - // CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeServicePrincipal), - // AuthorityURL: to.Ptr("string"), - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // ResourceURL: to.Ptr("string"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureDataLakeGen2), - // AccountName: to.Ptr("string"), - // Endpoint: to.Ptr("string"), - // Filesystem: to.Ptr("string"), - // Protocol: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json -func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureFileStoreWAccountKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.Datastore{ - Properties: &armmachinelearning.AzureFileDatastore{ - Description: to.Ptr("string"), - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - Credentials: &armmachinelearning.AccountKeyDatastoreCredentials{ - CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeAccountKey), - Secrets: &armmachinelearning.AccountKeyDatastoreSecrets{ - SecretsType: to.Ptr(armmachinelearning.SecretsTypeAccountKey), - Key: to.Ptr("string"), - }, - }, - DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureFile), - AccountName: to.Ptr("string"), - Endpoint: to.Ptr("string"), - FileShareName: to.Ptr("string"), - Protocol: to.Ptr("string"), - }, - }, &armmachinelearning.DatastoresClientCreateOrUpdateOptions{SkipValidation: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armmachinelearning.Datastore{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.AzureFileDatastore{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Credentials: &armmachinelearning.AccountKeyDatastoreCredentials{ - // CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeAccountKey), - // }, - // DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureFile), - // AccountName: to.Ptr("string"), - // Endpoint: to.Ptr("string"), - // FileShareName: to.Ptr("string"), - // Protocol: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json -func ExampleDatastoresClient_CreateOrUpdate_createOrUpdateDatastoreAzureBlobWAccountKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.Datastore{ - Properties: &armmachinelearning.AzureBlobDatastore{ - Description: to.Ptr("string"), - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - Credentials: &armmachinelearning.AccountKeyDatastoreCredentials{ - CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeAccountKey), - Secrets: &armmachinelearning.AccountKeyDatastoreSecrets{ - SecretsType: to.Ptr(armmachinelearning.SecretsTypeAccountKey), - Key: to.Ptr("string"), - }, - }, - DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureBlob), - AccountName: to.Ptr("string"), - ContainerName: to.Ptr("string"), - Endpoint: to.Ptr("core.windows.net"), - Protocol: to.Ptr("https"), - }, - }, &armmachinelearning.DatastoresClientCreateOrUpdateOptions{SkipValidation: to.Ptr(false)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Datastore = armmachinelearning.Datastore{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.AzureBlobDatastore{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Credentials: &armmachinelearning.AccountKeyDatastoreCredentials{ - // CredentialsType: to.Ptr(armmachinelearning.CredentialsTypeAccountKey), - // }, - // DatastoreType: to.Ptr(armmachinelearning.DatastoreTypeAzureBlob), - // IsDefault: to.Ptr(false), - // AccountName: to.Ptr("string"), - // ContainerName: to.Ptr("string"), - // Endpoint: to.Ptr("core.windows.net"), - // Protocol: to.Ptr("https"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Datastore/listSecrets.json -func ExampleDatastoresClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().ListSecrets(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armmachinelearning.DatastoresClientListSecretsResponse{ - // DatastoreSecretsClassification: &armmachinelearning.AccountKeyDatastoreSecrets{ - // SecretsType: to.Ptr(armmachinelearning.SecretsTypeAccountKey), - // Key: to.Ptr("string"), - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client.go index 81af82508f27..94a07b02b8df 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type DataVersionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDataVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataVersionsClient, error) { - cl, err := arm.NewClient(moduleName+".DataVersionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewDataVersionsClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -57,18 +56,25 @@ func NewDataVersionsClient(subscriptionID string, credential azcore.TokenCredent // - options - DataVersionsClientCreateOrUpdateOptions contains the optional parameters for the DataVersionsClient.CreateOrUpdate // method. func (client *DataVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DataVersionBase, options *DataVersionsClientCreateOrUpdateOptions) (DataVersionsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "DataVersionsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) if err != nil { return DataVersionsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataVersionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DataVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DataVersionsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,10 +105,13 @@ func (client *DataVersionsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,23 +126,29 @@ func (client *DataVersionsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Delete version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - version - Version identifier. // - options - DataVersionsClientDeleteOptions contains the optional parameters for the DataVersionsClient.Delete method. func (client *DataVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *DataVersionsClientDeleteOptions) (DataVersionsClientDeleteResponse, error) { + var err error + const operationName = "DataVersionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return DataVersionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataVersionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DataVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DataVersionsClientDeleteResponse{}, err } return DataVersionsClientDeleteResponse{}, nil } @@ -166,7 +181,7 @@ func (client *DataVersionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,25 +190,32 @@ func (client *DataVersionsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. // - version - Version identifier. // - options - DataVersionsClientGetOptions contains the optional parameters for the DataVersionsClient.Get method. func (client *DataVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *DataVersionsClientGetOptions) (DataVersionsClientGetResponse, error) { + var err error + const operationName = "DataVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return DataVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DataVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DataVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -224,7 +246,7 @@ func (client *DataVersionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +263,7 @@ func (client *DataVersionsClient) getHandleResponse(resp *http.Response) (DataVe // NewListPager - List data versions in the data container // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Data container's name @@ -252,25 +274,20 @@ func (client *DataVersionsClient) NewListPager(resourceGroupName string, workspa return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *DataVersionsClientListResponse) (DataVersionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DataVersionsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DataVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) if err != nil { return DataVersionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DataVersionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -298,7 +315,7 @@ func (client *DataVersionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } @@ -314,6 +331,9 @@ func (client *DataVersionsClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,3 +347,94 @@ func (client *DataVersionsClient) listHandleResponse(resp *http.Response) (DataV } return result, nil } + +// BeginPublish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. +// - version - Version identifier. +// - body - Destination registry info +// - options - DataVersionsClientBeginPublishOptions contains the optional parameters for the DataVersionsClient.BeginPublish +// method. +func (client *DataVersionsClient) BeginPublish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *DataVersionsClientBeginPublishOptions) (*runtime.Poller[DataVersionsClientPublishResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.publish(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DataVersionsClientPublishResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DataVersionsClientPublishResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Publish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *DataVersionsClient) publish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *DataVersionsClientBeginPublishOptions) (*http.Response, error) { + var err error + const operationName = "DataVersionsClient.BeginPublish" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.publishCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// publishCreateRequest creates the Publish request. +func (client *DataVersionsClient) publishCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *DataVersionsClientBeginPublishOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name}/versions/{version}/publish" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client_example_test.go deleted file mode 100644 index 2fdcdd57f145..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client_example_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/list.json -func ExampleDataVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearning.DataVersionsClientListOptions{OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Skip: nil, - Tags: to.Ptr("string"), - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataVersionBaseResourceArmPaginatedResult = armmachinelearning.DataVersionBaseResourceArmPaginatedResult{ - // Value: []*armmachinelearning.DataVersionBase{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.URIFileDataVersion{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // DataType: to.Ptr(armmachinelearning.DataTypeURIFile), - // DataURI: to.Ptr("string"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/delete.json -func ExampleDataVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/get.json -func ExampleDataVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataVersionBase = armmachinelearning.DataVersionBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.URIFileDataVersion{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // DataType: to.Ptr(armmachinelearning.DataTypeURIFile), - // DataURI: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/DataVersionBase/createOrUpdate.json -func ExampleDataVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearning.DataVersionBase{ - Properties: &armmachinelearning.URIFileDataVersion{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - IsAnonymous: to.Ptr(false), - DataType: to.Ptr(armmachinelearning.DataTypeURIFile), - DataURI: to.Ptr("string"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataVersionBase = armmachinelearning.DataVersionBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.URIFileDataVersion{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // DataType: to.Ptr(armmachinelearning.DataTypeURIFile), - // DataURI: to.Ptr("string"), - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client.go index 3748216d0062..74bedac70599 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type EnvironmentContainersClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewEnvironmentContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentContainersClient, error) { - cl, err := arm.NewClient(moduleName+".EnvironmentContainersClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,7 +46,7 @@ func NewEnvironmentContainersClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Create or update container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -55,18 +54,25 @@ func NewEnvironmentContainersClient(subscriptionID string, credential azcore.Tok // - options - EnvironmentContainersClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentContainersClient.CreateOrUpdate // method. func (client *EnvironmentContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body EnvironmentContainer, options *EnvironmentContainersClientCreateOrUpdateOptions) (EnvironmentContainersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "EnvironmentContainersClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return EnvironmentContainersClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EnvironmentContainersClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return EnvironmentContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return EnvironmentContainersClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -93,10 +99,13 @@ func (client *EnvironmentContainersClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -111,23 +120,29 @@ func (client *EnvironmentContainersClient) createOrUpdateHandleResponse(resp *ht // Delete - Delete container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - options - EnvironmentContainersClientDeleteOptions contains the optional parameters for the EnvironmentContainersClient.Delete // method. func (client *EnvironmentContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentContainersClientDeleteOptions) (EnvironmentContainersClientDeleteResponse, error) { + var err error + const operationName = "EnvironmentContainersClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return EnvironmentContainersClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EnvironmentContainersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return EnvironmentContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return EnvironmentContainersClientDeleteResponse{}, err } return EnvironmentContainersClientDeleteResponse{}, nil } @@ -156,7 +171,7 @@ func (client *EnvironmentContainersClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -165,25 +180,32 @@ func (client *EnvironmentContainersClient) deleteCreateRequest(ctx context.Conte // Get - Get container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - options - EnvironmentContainersClientGetOptions contains the optional parameters for the EnvironmentContainersClient.Get // method. func (client *EnvironmentContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *EnvironmentContainersClientGetOptions) (EnvironmentContainersClientGetResponse, error) { + var err error + const operationName = "EnvironmentContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return EnvironmentContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EnvironmentContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EnvironmentContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EnvironmentContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -210,7 +232,7 @@ func (client *EnvironmentContainersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,7 +249,7 @@ func (client *EnvironmentContainersClient) getHandleResponse(resp *http.Response // NewListPager - List environment containers. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - EnvironmentContainersClientListOptions contains the optional parameters for the EnvironmentContainersClient.NewListPager @@ -238,25 +260,20 @@ func (client *EnvironmentContainersClient) NewListPager(resourceGroupName string return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *EnvironmentContainersClientListResponse) (EnvironmentContainersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "EnvironmentContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return EnvironmentContainersClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return EnvironmentContainersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EnvironmentContainersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -280,7 +297,7 @@ func (client *EnvironmentContainersClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client_example_test.go deleted file mode 100644 index 463bd10a1f73..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client_example_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/list.json -func ExampleEnvironmentContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEnvironmentContainersClient().NewListPager("testrg123", "testworkspace", &armmachinelearning.EnvironmentContainersClientListOptions{Skip: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EnvironmentContainerResourceArmPaginatedResult = armmachinelearning.EnvironmentContainerResourceArmPaginatedResult{ - // Value: []*armmachinelearning.EnvironmentContainer{ - // { - // Name: to.Ptr("testEnvironment"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/environments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/environments/testEnvironment"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.EnvironmentContainerProperties{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/delete.json -func ExampleEnvironmentContainersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewEnvironmentContainersClient().Delete(ctx, "testrg123", "testworkspace", "testContainer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/get.json -func ExampleEnvironmentContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentContainersClient().Get(ctx, "testrg123", "testworkspace", "testEnvironment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EnvironmentContainer = armmachinelearning.EnvironmentContainer{ - // Name: to.Ptr("testEnvironment"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/environments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/environments/testEnvironment"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.EnvironmentContainerProperties{ - // Description: to.Ptr("string"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentContainer/createOrUpdate.json -func ExampleEnvironmentContainersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentContainersClient().CreateOrUpdate(ctx, "testrg123", "testworkspace", "testEnvironment", armmachinelearning.EnvironmentContainer{ - Properties: &armmachinelearning.EnvironmentContainerProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "additionalProp1": to.Ptr("string"), - "additionalProp2": to.Ptr("string"), - "additionalProp3": to.Ptr("string"), - }, - Tags: map[string]*string{ - "additionalProp1": to.Ptr("string"), - "additionalProp2": to.Ptr("string"), - "additionalProp3": to.Ptr("string"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EnvironmentContainer = armmachinelearning.EnvironmentContainer{ - // Name: to.Ptr("testEnvironment"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/environments"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/environments/testEnvironment"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-04T03:39:11.300Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-04T03:39:11.300Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.EnvironmentContainerProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client.go index 5cc6411d1b64..e7e6c8487c48 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type EnvironmentVersionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewEnvironmentVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentVersionsClient, error) { - cl, err := arm.NewClient(moduleName+".EnvironmentVersionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewEnvironmentVersionsClient(subscriptionID string, credential azcore.Token // CreateOrUpdate - Creates or updates an EnvironmentVersion. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Name of EnvironmentVersion. This is case-sensitive. @@ -57,18 +56,25 @@ func NewEnvironmentVersionsClient(subscriptionID string, credential azcore.Token // - options - EnvironmentVersionsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentVersionsClient.CreateOrUpdate // method. func (client *EnvironmentVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body EnvironmentVersion, options *EnvironmentVersionsClientCreateOrUpdateOptions) (EnvironmentVersionsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "EnvironmentVersionsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) if err != nil { return EnvironmentVersionsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EnvironmentVersionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return EnvironmentVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return EnvironmentVersionsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,10 +105,13 @@ func (client *EnvironmentVersionsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,7 +126,7 @@ func (client *EnvironmentVersionsClient) createOrUpdateHandleResponse(resp *http // Delete - Delete version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -125,16 +134,22 @@ func (client *EnvironmentVersionsClient) createOrUpdateHandleResponse(resp *http // - options - EnvironmentVersionsClientDeleteOptions contains the optional parameters for the EnvironmentVersionsClient.Delete // method. func (client *EnvironmentVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *EnvironmentVersionsClientDeleteOptions) (EnvironmentVersionsClientDeleteResponse, error) { + var err error + const operationName = "EnvironmentVersionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return EnvironmentVersionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EnvironmentVersionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return EnvironmentVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return EnvironmentVersionsClientDeleteResponse{}, err } return EnvironmentVersionsClientDeleteResponse{}, nil } @@ -167,7 +182,7 @@ func (client *EnvironmentVersionsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,25 +191,32 @@ func (client *EnvironmentVersionsClient) deleteCreateRequest(ctx context.Context // Get - Get version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - version - Version identifier. This is case-sensitive. // - options - EnvironmentVersionsClientGetOptions contains the optional parameters for the EnvironmentVersionsClient.Get method. func (client *EnvironmentVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *EnvironmentVersionsClientGetOptions) (EnvironmentVersionsClientGetResponse, error) { + var err error + const operationName = "EnvironmentVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return EnvironmentVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EnvironmentVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EnvironmentVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EnvironmentVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +247,7 @@ func (client *EnvironmentVersionsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +264,7 @@ func (client *EnvironmentVersionsClient) getHandleResponse(resp *http.Response) // NewListPager - List versions. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -254,25 +276,20 @@ func (client *EnvironmentVersionsClient) NewListPager(resourceGroupName string, return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *EnvironmentVersionsClientListResponse) (EnvironmentVersionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return EnvironmentVersionsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "EnvironmentVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) if err != nil { return EnvironmentVersionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EnvironmentVersionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -300,7 +317,7 @@ func (client *EnvironmentVersionsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } @@ -313,6 +330,9 @@ func (client *EnvironmentVersionsClient) listCreateRequest(ctx context.Context, if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,3 +346,94 @@ func (client *EnvironmentVersionsClient) listHandleResponse(resp *http.Response) } return result, nil } + +// BeginPublish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. +// - version - Version identifier. +// - body - Destination registry info +// - options - EnvironmentVersionsClientBeginPublishOptions contains the optional parameters for the EnvironmentVersionsClient.BeginPublish +// method. +func (client *EnvironmentVersionsClient) BeginPublish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *EnvironmentVersionsClientBeginPublishOptions) (*runtime.Poller[EnvironmentVersionsClientPublishResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.publish(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EnvironmentVersionsClientPublishResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[EnvironmentVersionsClientPublishResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Publish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *EnvironmentVersionsClient) publish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *EnvironmentVersionsClientBeginPublishOptions) (*http.Response, error) { + var err error + const operationName = "EnvironmentVersionsClient.BeginPublish" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.publishCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// publishCreateRequest creates the Publish request. +func (client *EnvironmentVersionsClient) publishCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *EnvironmentVersionsClientBeginPublishOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name}/versions/{version}/publish" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client_example_test.go deleted file mode 100644 index be4e3ab10faa..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client_example_test.go +++ /dev/null @@ -1,271 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/list.json -func ExampleEnvironmentVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEnvironmentVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearning.EnvironmentVersionsClientListOptions{OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Skip: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EnvironmentVersionResourceArmPaginatedResult = armmachinelearning.EnvironmentVersionResourceArmPaginatedResult{ - // Value: []*armmachinelearning.EnvironmentVersion{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.EnvironmentVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // Build: &armmachinelearning.BuildContext{ - // ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"), - // DockerfilePath: to.Ptr("prod/Dockerfile"), - // }, - // CondaFile: to.Ptr("string"), - // EnvironmentType: to.Ptr(armmachinelearning.EnvironmentTypeCurated), - // Image: to.Ptr("docker.io/tensorflow/serving:latest"), - // InferenceConfig: &armmachinelearning.InferenceContainerProperties{ - // LivenessRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // ReadinessRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // ScoringRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/delete.json -func ExampleEnvironmentVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewEnvironmentVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/get.json -func ExampleEnvironmentVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EnvironmentVersion = armmachinelearning.EnvironmentVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.EnvironmentVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // Build: &armmachinelearning.BuildContext{ - // ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"), - // DockerfilePath: to.Ptr("prod/Dockerfile"), - // }, - // CondaFile: to.Ptr("string"), - // EnvironmentType: to.Ptr(armmachinelearning.EnvironmentTypeCurated), - // Image: to.Ptr("docker.io/tensorflow/serving:latest"), - // InferenceConfig: &armmachinelearning.InferenceContainerProperties{ - // LivenessRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // ReadinessRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // ScoringRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/EnvironmentVersion/createOrUpdate.json -func ExampleEnvironmentVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearning.EnvironmentVersion{ - Properties: &armmachinelearning.EnvironmentVersionProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - IsAnonymous: to.Ptr(false), - Build: &armmachinelearning.BuildContext{ - ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"), - DockerfilePath: to.Ptr("prod/Dockerfile"), - }, - CondaFile: to.Ptr("string"), - Image: to.Ptr("docker.io/tensorflow/serving:latest"), - InferenceConfig: &armmachinelearning.InferenceContainerProperties{ - LivenessRoute: &armmachinelearning.Route{ - Path: to.Ptr("string"), - Port: to.Ptr[int32](1), - }, - ReadinessRoute: &armmachinelearning.Route{ - Path: to.Ptr("string"), - Port: to.Ptr[int32](1), - }, - ScoringRoute: &armmachinelearning.Route{ - Path: to.Ptr("string"), - Port: to.Ptr[int32](1), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EnvironmentVersion = armmachinelearning.EnvironmentVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.EnvironmentVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // Build: &armmachinelearning.BuildContext{ - // ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"), - // DockerfilePath: to.Ptr("prod/Dockerfile"), - // }, - // CondaFile: to.Ptr("string"), - // EnvironmentType: to.Ptr(armmachinelearning.EnvironmentTypeCurated), - // Image: to.Ptr("docker.io/tensorflow/serving:latest"), - // InferenceConfig: &armmachinelearning.InferenceContainerProperties{ - // LivenessRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // ReadinessRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // ScoringRoute: &armmachinelearning.Route{ - // Path: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchdeployments_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchdeployments_server.go new file mode 100644 index 000000000000..3143e8b589cd --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchdeployments_server.go @@ -0,0 +1,386 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// BatchDeploymentsServer is a fake server for instances of the armmachinelearning.BatchDeploymentsClient type. +type BatchDeploymentsServer struct { + // BeginCreateOrUpdate is the fake for method BatchDeploymentsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body armmachinelearning.BatchDeployment, options *armmachinelearning.BatchDeploymentsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method BatchDeploymentsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *armmachinelearning.BatchDeploymentsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method BatchDeploymentsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *armmachinelearning.BatchDeploymentsClientGetOptions) (resp azfake.Responder[armmachinelearning.BatchDeploymentsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method BatchDeploymentsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.BatchDeploymentsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.BatchDeploymentsClientListResponse]) + + // BeginUpdate is the fake for method BatchDeploymentsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body armmachinelearning.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties, options *armmachinelearning.BatchDeploymentsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewBatchDeploymentsServerTransport creates a new instance of BatchDeploymentsServerTransport with the provided implementation. +// The returned BatchDeploymentsServerTransport instance is connected to an instance of armmachinelearning.BatchDeploymentsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewBatchDeploymentsServerTransport(srv *BatchDeploymentsServer) *BatchDeploymentsServerTransport { + return &BatchDeploymentsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.BatchDeploymentsClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientUpdateResponse]](), + } +} + +// BatchDeploymentsServerTransport connects instances of armmachinelearning.BatchDeploymentsClient to instances of BatchDeploymentsServer. +// Don't use this type directly, use NewBatchDeploymentsServerTransport instead. +type BatchDeploymentsServerTransport struct { + srv *BatchDeploymentsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.BatchDeploymentsClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.BatchDeploymentsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for BatchDeploymentsServerTransport. +func (b *BatchDeploymentsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "BatchDeploymentsClient.BeginCreateOrUpdate": + resp, err = b.dispatchBeginCreateOrUpdate(req) + case "BatchDeploymentsClient.BeginDelete": + resp, err = b.dispatchBeginDelete(req) + case "BatchDeploymentsClient.Get": + resp, err = b.dispatchGet(req) + case "BatchDeploymentsClient.NewListPager": + resp, err = b.dispatchNewListPager(req) + case "BatchDeploymentsClient.BeginUpdate": + resp, err = b.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (b *BatchDeploymentsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if b.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := b.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.BatchDeployment](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + b.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + b.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + b.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (b *BatchDeploymentsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if b.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := b.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + b.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + b.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + b.beginDelete.remove(req) + } + + return resp, nil +} + +func (b *BatchDeploymentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if b.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BatchDeployment, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (b *BatchDeploymentsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if b.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := b.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.BatchDeploymentsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil { + options = &armmachinelearning.BatchDeploymentsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + } + } + resp := b.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, endpointNameParam, options) + newListPager = &resp + b.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.BatchDeploymentsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + b.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + b.newListPager.remove(req) + } + return resp, nil +} + +func (b *BatchDeploymentsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if b.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := b.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + b.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + b.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + b.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go new file mode 100644 index 000000000000..df27032f5140 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go @@ -0,0 +1,403 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// BatchEndpointsServer is a fake server for instances of the armmachinelearning.BatchEndpointsClient type. +type BatchEndpointsServer struct { + // BeginCreateOrUpdate is the fake for method BatchEndpointsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body armmachinelearning.BatchEndpoint, options *armmachinelearning.BatchEndpointsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.BatchEndpointsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method BatchEndpointsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.BatchEndpointsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.BatchEndpointsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method BatchEndpointsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.BatchEndpointsClientGetOptions) (resp azfake.Responder[armmachinelearning.BatchEndpointsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method BatchEndpointsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.BatchEndpointsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.BatchEndpointsClientListResponse]) + + // ListKeys is the fake for method BatchEndpointsClient.ListKeys + // HTTP status codes to indicate success: http.StatusOK + ListKeys func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.BatchEndpointsClientListKeysOptions) (resp azfake.Responder[armmachinelearning.BatchEndpointsClientListKeysResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method BatchEndpointsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body armmachinelearning.PartialMinimalTrackedResourceWithIdentity, options *armmachinelearning.BatchEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.BatchEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewBatchEndpointsServerTransport creates a new instance of BatchEndpointsServerTransport with the provided implementation. +// The returned BatchEndpointsServerTransport instance is connected to an instance of armmachinelearning.BatchEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewBatchEndpointsServerTransport(srv *BatchEndpointsServer) *BatchEndpointsServerTransport { + return &BatchEndpointsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.BatchEndpointsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.BatchEndpointsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.BatchEndpointsClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.BatchEndpointsClientUpdateResponse]](), + } +} + +// BatchEndpointsServerTransport connects instances of armmachinelearning.BatchEndpointsClient to instances of BatchEndpointsServer. +// Don't use this type directly, use NewBatchEndpointsServerTransport instead. +type BatchEndpointsServerTransport struct { + srv *BatchEndpointsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.BatchEndpointsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.BatchEndpointsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.BatchEndpointsClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.BatchEndpointsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for BatchEndpointsServerTransport. +func (b *BatchEndpointsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "BatchEndpointsClient.BeginCreateOrUpdate": + resp, err = b.dispatchBeginCreateOrUpdate(req) + case "BatchEndpointsClient.BeginDelete": + resp, err = b.dispatchBeginDelete(req) + case "BatchEndpointsClient.Get": + resp, err = b.dispatchGet(req) + case "BatchEndpointsClient.NewListPager": + resp, err = b.dispatchNewListPager(req) + case "BatchEndpointsClient.ListKeys": + resp, err = b.dispatchListKeys(req) + case "BatchEndpointsClient.BeginUpdate": + resp, err = b.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (b *BatchEndpointsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if b.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := b.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.BatchEndpoint](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + b.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + b.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + b.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (b *BatchEndpointsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if b.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := b.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + b.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + b.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + b.beginDelete.remove(req) + } + + return resp, nil +} + +func (b *BatchEndpointsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if b.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BatchEndpoint, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (b *BatchEndpointsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if b.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := b.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.BatchEndpointsClientListOptions + if countParam != nil || skipParam != nil { + options = &armmachinelearning.BatchEndpointsClientListOptions{ + Count: countParam, + Skip: skipParam, + } + } + resp := b.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + b.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.BatchEndpointsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + b.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + b.newListPager.remove(req) + } + return resp, nil +} + +func (b *BatchEndpointsServerTransport) dispatchListKeys(req *http.Request) (*http.Response, error) { + if b.srv.ListKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listkeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.ListKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EndpointAuthKeys, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (b *BatchEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if b.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := b.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/batchEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithIdentity](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + b.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + b.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + b.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/capacityreservationgroups_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/capacityreservationgroups_server.go new file mode 100644 index 000000000000..c13bb4f96c6d --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/capacityreservationgroups_server.go @@ -0,0 +1,338 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// CapacityReservationGroupsServer is a fake server for instances of the armmachinelearning.CapacityReservationGroupsClient type. +type CapacityReservationGroupsServer struct { + // CreateOrUpdate is the fake for method CapacityReservationGroupsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, groupID string, body armmachinelearning.CapacityReservationGroup, options *armmachinelearning.CapacityReservationGroupsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.CapacityReservationGroupsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method CapacityReservationGroupsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, groupID string, options *armmachinelearning.CapacityReservationGroupsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.CapacityReservationGroupsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method CapacityReservationGroupsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, groupID string, options *armmachinelearning.CapacityReservationGroupsClientGetOptions) (resp azfake.Responder[armmachinelearning.CapacityReservationGroupsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method CapacityReservationGroupsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armmachinelearning.CapacityReservationGroupsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.CapacityReservationGroupsClientListResponse]) + + // NewListBySubscriptionPager is the fake for method CapacityReservationGroupsClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armmachinelearning.CapacityReservationGroupsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armmachinelearning.CapacityReservationGroupsClientListBySubscriptionResponse]) + + // Update is the fake for method CapacityReservationGroupsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, groupID string, body armmachinelearning.PartialMinimalTrackedResourceWithSKUAndIdentity, options *armmachinelearning.CapacityReservationGroupsClientUpdateOptions) (resp azfake.Responder[armmachinelearning.CapacityReservationGroupsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewCapacityReservationGroupsServerTransport creates a new instance of CapacityReservationGroupsServerTransport with the provided implementation. +// The returned CapacityReservationGroupsServerTransport instance is connected to an instance of armmachinelearning.CapacityReservationGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCapacityReservationGroupsServerTransport(srv *CapacityReservationGroupsServer) *CapacityReservationGroupsServerTransport { + return &CapacityReservationGroupsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.CapacityReservationGroupsClientListResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmachinelearning.CapacityReservationGroupsClientListBySubscriptionResponse]](), + } +} + +// CapacityReservationGroupsServerTransport connects instances of armmachinelearning.CapacityReservationGroupsClient to instances of CapacityReservationGroupsServer. +// Don't use this type directly, use NewCapacityReservationGroupsServerTransport instead. +type CapacityReservationGroupsServerTransport struct { + srv *CapacityReservationGroupsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.CapacityReservationGroupsClientListResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmachinelearning.CapacityReservationGroupsClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for CapacityReservationGroupsServerTransport. +func (c *CapacityReservationGroupsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "CapacityReservationGroupsClient.CreateOrUpdate": + resp, err = c.dispatchCreateOrUpdate(req) + case "CapacityReservationGroupsClient.Delete": + resp, err = c.dispatchDelete(req) + case "CapacityReservationGroupsClient.Get": + resp, err = c.dispatchGet(req) + case "CapacityReservationGroupsClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + case "CapacityReservationGroupsClient.NewListBySubscriptionPager": + resp, err = c.dispatchNewListBySubscriptionPager(req) + case "CapacityReservationGroupsClient.Update": + resp, err = c.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *CapacityReservationGroupsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/capacityReserverationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.CapacityReservationGroup](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, groupIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CapacityReservationGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CapacityReservationGroupsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/capacityReserverationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Delete(req.Context(), resourceGroupNameParam, groupIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CapacityReservationGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/capacityReserverationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, groupIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CapacityReservationGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CapacityReservationGroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/capacityReserverationGroups` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.CapacityReservationGroupsClientListOptions + if skipParam != nil { + options = &armmachinelearning.CapacityReservationGroupsClientListOptions{ + Skip: skipParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.CapacityReservationGroupsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +func (c *CapacityReservationGroupsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := c.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/capacityReserverationGroups` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.CapacityReservationGroupsClientListBySubscriptionOptions + if skipParam != nil { + options = &armmachinelearning.CapacityReservationGroupsClientListBySubscriptionOptions{ + Skip: skipParam, + } + } + resp := c.srv.NewListBySubscriptionPager(options) + newListBySubscriptionPager = &resp + c.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmachinelearning.CapacityReservationGroupsClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + c.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (c *CapacityReservationGroupsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if c.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/capacityReserverationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithSKUAndIdentity](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + groupIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupId")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Update(req.Context(), resourceGroupNameParam, groupIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CapacityReservationGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go new file mode 100644 index 000000000000..1e48cbe1c9ca --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go @@ -0,0 +1,258 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// CodeContainersServer is a fake server for instances of the armmachinelearning.CodeContainersClient type. +type CodeContainersServer struct { + // CreateOrUpdate is the fake for method CodeContainersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.CodeContainer, options *armmachinelearning.CodeContainersClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.CodeContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method CodeContainersClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.CodeContainersClientDeleteOptions) (resp azfake.Responder[armmachinelearning.CodeContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method CodeContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.CodeContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.CodeContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method CodeContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.CodeContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.CodeContainersClientListResponse]) +} + +// NewCodeContainersServerTransport creates a new instance of CodeContainersServerTransport with the provided implementation. +// The returned CodeContainersServerTransport instance is connected to an instance of armmachinelearning.CodeContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCodeContainersServerTransport(srv *CodeContainersServer) *CodeContainersServerTransport { + return &CodeContainersServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.CodeContainersClientListResponse]](), + } +} + +// CodeContainersServerTransport connects instances of armmachinelearning.CodeContainersClient to instances of CodeContainersServer. +// Don't use this type directly, use NewCodeContainersServerTransport instead. +type CodeContainersServerTransport struct { + srv *CodeContainersServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.CodeContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for CodeContainersServerTransport. +func (c *CodeContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "CodeContainersClient.CreateOrUpdate": + resp, err = c.dispatchCreateOrUpdate(req) + case "CodeContainersClient.Delete": + resp, err = c.dispatchDelete(req) + case "CodeContainersClient.Get": + resp, err = c.dispatchGet(req) + case "CodeContainersClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *CodeContainersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.CodeContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CodeContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeContainersServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CodeContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.CodeContainersClientListOptions + if skipParam != nil { + options = &armmachinelearning.CodeContainersClientListOptions{ + Skip: skipParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.CodeContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go new file mode 100644 index 000000000000..30d9093dc163 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go @@ -0,0 +1,423 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// CodeVersionsServer is a fake server for instances of the armmachinelearning.CodeVersionsClient type. +type CodeVersionsServer struct { + // CreateOrGetStartPendingUpload is the fake for method CodeVersionsClient.CreateOrGetStartPendingUpload + // HTTP status codes to indicate success: http.StatusOK + CreateOrGetStartPendingUpload func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.PendingUploadRequestDto, options *armmachinelearning.CodeVersionsClientCreateOrGetStartPendingUploadOptions) (resp azfake.Responder[armmachinelearning.CodeVersionsClientCreateOrGetStartPendingUploadResponse], errResp azfake.ErrorResponder) + + // CreateOrUpdate is the fake for method CodeVersionsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.CodeVersion, options *armmachinelearning.CodeVersionsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.CodeVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method CodeVersionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.CodeVersionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.CodeVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method CodeVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.CodeVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.CodeVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method CodeVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.CodeVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.CodeVersionsClientListResponse]) + + // BeginPublish is the fake for method CodeVersionsClient.BeginPublish + // HTTP status codes to indicate success: http.StatusAccepted + BeginPublish func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.DestinationAsset, options *armmachinelearning.CodeVersionsClientBeginPublishOptions) (resp azfake.PollerResponder[armmachinelearning.CodeVersionsClientPublishResponse], errResp azfake.ErrorResponder) +} + +// NewCodeVersionsServerTransport creates a new instance of CodeVersionsServerTransport with the provided implementation. +// The returned CodeVersionsServerTransport instance is connected to an instance of armmachinelearning.CodeVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCodeVersionsServerTransport(srv *CodeVersionsServer) *CodeVersionsServerTransport { + return &CodeVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.CodeVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.CodeVersionsClientPublishResponse]](), + } +} + +// CodeVersionsServerTransport connects instances of armmachinelearning.CodeVersionsClient to instances of CodeVersionsServer. +// Don't use this type directly, use NewCodeVersionsServerTransport instead. +type CodeVersionsServerTransport struct { + srv *CodeVersionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.CodeVersionsClientListResponse]] + beginPublish *tracker[azfake.PollerResponder[armmachinelearning.CodeVersionsClientPublishResponse]] +} + +// Do implements the policy.Transporter interface for CodeVersionsServerTransport. +func (c *CodeVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "CodeVersionsClient.CreateOrGetStartPendingUpload": + resp, err = c.dispatchCreateOrGetStartPendingUpload(req) + case "CodeVersionsClient.CreateOrUpdate": + resp, err = c.dispatchCreateOrUpdate(req) + case "CodeVersionsClient.Delete": + resp, err = c.dispatchDelete(req) + case "CodeVersionsClient.Get": + resp, err = c.dispatchGet(req) + case "CodeVersionsClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + case "CodeVersionsClient.BeginPublish": + resp, err = c.dispatchBeginPublish(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *CodeVersionsServerTransport) dispatchCreateOrGetStartPendingUpload(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrGetStartPendingUpload == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrGetStartPendingUpload not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startPendingUpload` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PendingUploadRequestDto](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrGetStartPendingUpload(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PendingUploadResponseDto, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeVersionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.CodeVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CodeVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeVersionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CodeVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CodeVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + hashUnescaped, err := url.QueryUnescape(qp.Get("hash")) + if err != nil { + return nil, err + } + hashParam := getOptional(hashUnescaped) + hashVersionUnescaped, err := url.QueryUnescape(qp.Get("hashVersion")) + if err != nil { + return nil, err + } + hashVersionParam := getOptional(hashVersionUnescaped) + var options *armmachinelearning.CodeVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || hashParam != nil || hashVersionParam != nil { + options = &armmachinelearning.CodeVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + Hash: hashParam, + HashVersion: hashVersionParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.CodeVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +func (c *CodeVersionsServerTransport) dispatchBeginPublish(req *http.Request) (*http.Response, error) { + if c.srv.BeginPublish == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPublish not implemented")} + } + beginPublish := c.beginPublish.get(req) + if beginPublish == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publish` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DestinationAsset](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginPublish(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPublish = &respr + c.beginPublish.add(req, beginPublish) + } + + resp, err := server.PollerResponderNext(beginPublish, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPublish) { + c.beginPublish.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentcontainers_server.go new file mode 100644 index 000000000000..6886342d57d0 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentcontainers_server.go @@ -0,0 +1,264 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// ComponentContainersServer is a fake server for instances of the armmachinelearning.ComponentContainersClient type. +type ComponentContainersServer struct { + // CreateOrUpdate is the fake for method ComponentContainersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.ComponentContainer, options *armmachinelearning.ComponentContainersClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.ComponentContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method ComponentContainersClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ComponentContainersClientDeleteOptions) (resp azfake.Responder[armmachinelearning.ComponentContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ComponentContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ComponentContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.ComponentContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ComponentContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.ComponentContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ComponentContainersClientListResponse]) +} + +// NewComponentContainersServerTransport creates a new instance of ComponentContainersServerTransport with the provided implementation. +// The returned ComponentContainersServerTransport instance is connected to an instance of armmachinelearning.ComponentContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewComponentContainersServerTransport(srv *ComponentContainersServer) *ComponentContainersServerTransport { + return &ComponentContainersServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ComponentContainersClientListResponse]](), + } +} + +// ComponentContainersServerTransport connects instances of armmachinelearning.ComponentContainersClient to instances of ComponentContainersServer. +// Don't use this type directly, use NewComponentContainersServerTransport instead. +type ComponentContainersServerTransport struct { + srv *ComponentContainersServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ComponentContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for ComponentContainersServerTransport. +func (c *ComponentContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ComponentContainersClient.CreateOrUpdate": + resp, err = c.dispatchCreateOrUpdate(req) + case "ComponentContainersClient.Delete": + resp, err = c.dispatchDelete(req) + case "ComponentContainersClient.Get": + resp, err = c.dispatchGet(req) + case "ComponentContainersClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ComponentContainersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ComponentContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComponentContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComponentContainersServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComponentContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComponentContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComponentContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.ComponentContainersClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.ComponentContainersClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ComponentContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go new file mode 100644 index 000000000000..e34392b7246d --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go @@ -0,0 +1,372 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// ComponentVersionsServer is a fake server for instances of the armmachinelearning.ComponentVersionsClient type. +type ComponentVersionsServer struct { + // CreateOrUpdate is the fake for method ComponentVersionsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.ComponentVersion, options *armmachinelearning.ComponentVersionsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.ComponentVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method ComponentVersionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.ComponentVersionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.ComponentVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ComponentVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.ComponentVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.ComponentVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ComponentVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ComponentVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ComponentVersionsClientListResponse]) + + // BeginPublish is the fake for method ComponentVersionsClient.BeginPublish + // HTTP status codes to indicate success: http.StatusAccepted + BeginPublish func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.DestinationAsset, options *armmachinelearning.ComponentVersionsClientBeginPublishOptions) (resp azfake.PollerResponder[armmachinelearning.ComponentVersionsClientPublishResponse], errResp azfake.ErrorResponder) +} + +// NewComponentVersionsServerTransport creates a new instance of ComponentVersionsServerTransport with the provided implementation. +// The returned ComponentVersionsServerTransport instance is connected to an instance of armmachinelearning.ComponentVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewComponentVersionsServerTransport(srv *ComponentVersionsServer) *ComponentVersionsServerTransport { + return &ComponentVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ComponentVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.ComponentVersionsClientPublishResponse]](), + } +} + +// ComponentVersionsServerTransport connects instances of armmachinelearning.ComponentVersionsClient to instances of ComponentVersionsServer. +// Don't use this type directly, use NewComponentVersionsServerTransport instead. +type ComponentVersionsServerTransport struct { + srv *ComponentVersionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ComponentVersionsClientListResponse]] + beginPublish *tracker[azfake.PollerResponder[armmachinelearning.ComponentVersionsClientPublishResponse]] +} + +// Do implements the policy.Transporter interface for ComponentVersionsServerTransport. +func (c *ComponentVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ComponentVersionsClient.CreateOrUpdate": + resp, err = c.dispatchCreateOrUpdate(req) + case "ComponentVersionsClient.Delete": + resp, err = c.dispatchDelete(req) + case "ComponentVersionsClient.Get": + resp, err = c.dispatchGet(req) + case "ComponentVersionsClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + case "ComponentVersionsClient.BeginPublish": + resp, err = c.dispatchBeginPublish(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ComponentVersionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ComponentVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComponentVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComponentVersionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComponentVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComponentVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComponentVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.ComponentVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || listViewTypeParam != nil || stageParam != nil { + options = &armmachinelearning.ComponentVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + ListViewType: listViewTypeParam, + Stage: stageParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ComponentVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +func (c *ComponentVersionsServerTransport) dispatchBeginPublish(req *http.Request) (*http.Response, error) { + if c.srv.BeginPublish == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPublish not implemented")} + } + beginPublish := c.beginPublish.get(req) + if beginPublish == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publish` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DestinationAsset](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginPublish(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPublish = &respr + c.beginPublish.add(req, beginPublish) + } + + resp, err := server.PollerResponderNext(beginPublish, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPublish) { + c.beginPublish.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/compute_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/compute_server.go new file mode 100644 index 000000000000..d93e4099ff6c --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/compute_server.go @@ -0,0 +1,816 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// ComputeServer is a fake server for instances of the armmachinelearning.ComputeClient type. +type ComputeServer struct { + // BeginCreateOrUpdate is the fake for method ComputeClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters armmachinelearning.ComputeResource, options *armmachinelearning.ComputeClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ComputeClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction armmachinelearning.UnderlyingResourceAction, options *armmachinelearning.ComputeClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ComputeClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientGetOptions) (resp azfake.Responder[armmachinelearning.ComputeClientGetResponse], errResp azfake.ErrorResponder) + + // GetAllowedResizeSizes is the fake for method ComputeClient.GetAllowedResizeSizes + // HTTP status codes to indicate success: http.StatusOK + GetAllowedResizeSizes func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientGetAllowedResizeSizesOptions) (resp azfake.Responder[armmachinelearning.ComputeClientGetAllowedResizeSizesResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ComputeClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.ComputeClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ComputeClientListResponse]) + + // ListKeys is the fake for method ComputeClient.ListKeys + // HTTP status codes to indicate success: http.StatusOK + ListKeys func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientListKeysOptions) (resp azfake.Responder[armmachinelearning.ComputeClientListKeysResponse], errResp azfake.ErrorResponder) + + // NewListNodesPager is the fake for method ComputeClient.NewListNodesPager + // HTTP status codes to indicate success: http.StatusOK + NewListNodesPager func(resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientListNodesOptions) (resp azfake.PagerResponder[armmachinelearning.ComputeClientListNodesResponse]) + + // BeginResize is the fake for method ComputeClient.BeginResize + // HTTP status codes to indicate success: http.StatusAccepted + BeginResize func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters armmachinelearning.ResizeSchema, options *armmachinelearning.ComputeClientBeginResizeOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientResizeResponse], errResp azfake.ErrorResponder) + + // BeginRestart is the fake for method ComputeClient.BeginRestart + // HTTP status codes to indicate success: http.StatusAccepted + BeginRestart func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientBeginRestartOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientRestartResponse], errResp azfake.ErrorResponder) + + // BeginStart is the fake for method ComputeClient.BeginStart + // HTTP status codes to indicate success: http.StatusAccepted + BeginStart func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientBeginStartOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientStartResponse], errResp azfake.ErrorResponder) + + // BeginStop is the fake for method ComputeClient.BeginStop + // HTTP status codes to indicate success: http.StatusAccepted + BeginStop func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, options *armmachinelearning.ComputeClientBeginStopOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientStopResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method ComputeClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters armmachinelearning.ClusterUpdateParameters, options *armmachinelearning.ComputeClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.ComputeClientUpdateResponse], errResp azfake.ErrorResponder) + + // UpdateCustomServices is the fake for method ComputeClient.UpdateCustomServices + // HTTP status codes to indicate success: http.StatusOK + UpdateCustomServices func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, customServices []*armmachinelearning.CustomService, options *armmachinelearning.ComputeClientUpdateCustomServicesOptions) (resp azfake.Responder[armmachinelearning.ComputeClientUpdateCustomServicesResponse], errResp azfake.ErrorResponder) + + // UpdateIdleShutdownSetting is the fake for method ComputeClient.UpdateIdleShutdownSetting + // HTTP status codes to indicate success: http.StatusOK + UpdateIdleShutdownSetting func(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters armmachinelearning.IdleShutdownSetting, options *armmachinelearning.ComputeClientUpdateIdleShutdownSettingOptions) (resp azfake.Responder[armmachinelearning.ComputeClientUpdateIdleShutdownSettingResponse], errResp azfake.ErrorResponder) +} + +// NewComputeServerTransport creates a new instance of ComputeServerTransport with the provided implementation. +// The returned ComputeServerTransport instance is connected to an instance of armmachinelearning.ComputeClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewComputeServerTransport(srv *ComputeServer) *ComputeServerTransport { + return &ComputeServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ComputeClientListResponse]](), + newListNodesPager: newTracker[azfake.PagerResponder[armmachinelearning.ComputeClientListNodesResponse]](), + beginResize: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientResizeResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientRestartResponse]](), + beginStart: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientStartResponse]](), + beginStop: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientStopResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.ComputeClientUpdateResponse]](), + } +} + +// ComputeServerTransport connects instances of armmachinelearning.ComputeClient to instances of ComputeServer. +// Don't use this type directly, use NewComputeServerTransport instead. +type ComputeServerTransport struct { + srv *ComputeServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ComputeClientListResponse]] + newListNodesPager *tracker[azfake.PagerResponder[armmachinelearning.ComputeClientListNodesResponse]] + beginResize *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientResizeResponse]] + beginRestart *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientRestartResponse]] + beginStart *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientStartResponse]] + beginStop *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientStopResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.ComputeClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for ComputeServerTransport. +func (c *ComputeServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ComputeClient.BeginCreateOrUpdate": + resp, err = c.dispatchBeginCreateOrUpdate(req) + case "ComputeClient.BeginDelete": + resp, err = c.dispatchBeginDelete(req) + case "ComputeClient.Get": + resp, err = c.dispatchGet(req) + case "ComputeClient.GetAllowedResizeSizes": + resp, err = c.dispatchGetAllowedResizeSizes(req) + case "ComputeClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + case "ComputeClient.ListKeys": + resp, err = c.dispatchListKeys(req) + case "ComputeClient.NewListNodesPager": + resp, err = c.dispatchNewListNodesPager(req) + case "ComputeClient.BeginResize": + resp, err = c.dispatchBeginResize(req) + case "ComputeClient.BeginRestart": + resp, err = c.dispatchBeginRestart(req) + case "ComputeClient.BeginStart": + resp, err = c.dispatchBeginStart(req) + case "ComputeClient.BeginStop": + resp, err = c.dispatchBeginStop(req) + case "ComputeClient.BeginUpdate": + resp, err = c.dispatchBeginUpdate(req) + case "ComputeClient.UpdateCustomServices": + resp, err = c.dispatchUpdateCustomServices(req) + case "ComputeClient.UpdateIdleShutdownSetting": + resp, err = c.dispatchUpdateIdleShutdownSetting(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ComputeResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + underlyingResourceActionParam, err := parseWithCast(qp.Get("underlyingResourceAction"), func(v string) (armmachinelearning.UnderlyingResourceAction, error) { + p, unescapeErr := url.QueryUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armmachinelearning.UnderlyingResourceAction(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, underlyingResourceActionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComputeResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComputeServerTransport) dispatchGetAllowedResizeSizes(req *http.Request) (*http.Response, error) { + if c.srv.GetAllowedResizeSizes == nil { + return nil, &nonRetriableError{errors.New("fake for method GetAllowedResizeSizes not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getAllowedVmSizesForResize` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.GetAllowedResizeSizes(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualMachineSizeListResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComputeServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.ComputeClientListOptions + if skipParam != nil { + options = &armmachinelearning.ComputeClientListOptions{ + Skip: skipParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ComputeClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +func (c *ComputeServerTransport) dispatchListKeys(req *http.Request) (*http.Response, error) { + if c.srv.ListKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.ListKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComputeSecretsClassification, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComputeServerTransport) dispatchNewListNodesPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListNodesPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListNodesPager not implemented")} + } + newListNodesPager := c.newListNodesPager.get(req) + if newListNodesPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listNodes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListNodesPager(resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + newListNodesPager = &resp + c.newListNodesPager.add(req, newListNodesPager) + server.PagerResponderInjectNextLinks(newListNodesPager, req, func(page *armmachinelearning.ComputeClientListNodesResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListNodesPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListNodesPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListNodesPager) { + c.newListNodesPager.remove(req) + } + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginResize(req *http.Request) (*http.Response, error) { + if c.srv.BeginResize == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginResize not implemented")} + } + beginResize := c.beginResize.get(req) + if beginResize == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resize` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ResizeSchema](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginResize(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginResize = &respr + c.beginResize.add(req, beginResize) + } + + resp, err := server.PollerResponderNext(beginResize, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginResize.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginResize) { + c.beginResize.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginRestart(req *http.Request) (*http.Response, error) { + if c.srv.BeginRestart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} + } + beginRestart := c.beginRestart.get(req) + if beginRestart == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginRestart(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRestart = &respr + c.beginRestart.add(req, beginRestart) + } + + resp, err := server.PollerResponderNext(beginRestart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginRestart.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRestart) { + c.beginRestart.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { + if c.srv.BeginStart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} + } + beginStart := c.beginStart.get(req) + if beginStart == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginStart(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStart = &respr + c.beginStart.add(req, beginStart) + } + + resp, err := server.PollerResponderNext(beginStart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginStart.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStart) { + c.beginStart.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginStop(req *http.Request) (*http.Response, error) { + if c.srv.BeginStop == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStop not implemented")} + } + beginStop := c.beginStop.get(req) + if beginStop == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stop` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginStop(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStop = &respr + c.beginStop.add(req, beginStop) + } + + resp, err := server.PollerResponderNext(beginStop, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginStop.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStop) { + c.beginStop.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := c.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ClusterUpdateParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + c.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + c.beginUpdate.remove(req) + } + + return resp, nil +} + +func (c *ComputeServerTransport) dispatchUpdateCustomServices(req *http.Request) (*http.Response, error) { + if c.srv.UpdateCustomServices == nil { + return nil, &nonRetriableError{errors.New("fake for method UpdateCustomServices not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/customServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[[]*armmachinelearning.CustomService](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.UpdateCustomServices(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ComputeServerTransport) dispatchUpdateIdleShutdownSetting(req *http.Request) (*http.Response, error) { + if c.srv.UpdateIdleShutdownSetting == nil { + return nil, &nonRetriableError{errors.New("fake for method UpdateIdleShutdownSetting not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/computes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateIdleShutdownSetting` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.IdleShutdownSetting](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + computeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("computeName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.UpdateIdleShutdownSetting(req.Context(), resourceGroupNameParam, workspaceNameParam, computeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go new file mode 100644 index 000000000000..fd3d1ef271e9 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go @@ -0,0 +1,264 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// DataContainersServer is a fake server for instances of the armmachinelearning.DataContainersClient type. +type DataContainersServer struct { + // CreateOrUpdate is the fake for method DataContainersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.DataContainer, options *armmachinelearning.DataContainersClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.DataContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method DataContainersClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.DataContainersClientDeleteOptions) (resp azfake.Responder[armmachinelearning.DataContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DataContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.DataContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.DataContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method DataContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.DataContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.DataContainersClientListResponse]) +} + +// NewDataContainersServerTransport creates a new instance of DataContainersServerTransport with the provided implementation. +// The returned DataContainersServerTransport instance is connected to an instance of armmachinelearning.DataContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDataContainersServerTransport(srv *DataContainersServer) *DataContainersServerTransport { + return &DataContainersServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.DataContainersClientListResponse]](), + } +} + +// DataContainersServerTransport connects instances of armmachinelearning.DataContainersClient to instances of DataContainersServer. +// Don't use this type directly, use NewDataContainersServerTransport instead. +type DataContainersServerTransport struct { + srv *DataContainersServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.DataContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for DataContainersServerTransport. +func (d *DataContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DataContainersClient.CreateOrUpdate": + resp, err = d.dispatchCreateOrUpdate(req) + case "DataContainersClient.Delete": + resp, err = d.dispatchDelete(req) + case "DataContainersClient.Get": + resp, err = d.dispatchGet(req) + case "DataContainersClient.NewListPager": + resp, err = d.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DataContainersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DataContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DataContainersServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if d.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DataContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DataContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := d.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.DataContainersClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.DataContainersClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := d.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.DataContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go new file mode 100644 index 000000000000..a1372a92110d --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go @@ -0,0 +1,368 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// DatastoresServer is a fake server for instances of the armmachinelearning.DatastoresClient type. +type DatastoresServer struct { + // CreateOrUpdate is the fake for method DatastoresClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.Datastore, options *armmachinelearning.DatastoresClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.DatastoresClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method DatastoresClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.DatastoresClientDeleteOptions) (resp azfake.Responder[armmachinelearning.DatastoresClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DatastoresClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.DatastoresClientGetOptions) (resp azfake.Responder[armmachinelearning.DatastoresClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method DatastoresClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.DatastoresClientListOptions) (resp azfake.PagerResponder[armmachinelearning.DatastoresClientListResponse]) + + // ListSecrets is the fake for method DatastoresClient.ListSecrets + // HTTP status codes to indicate success: http.StatusOK + ListSecrets func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.DatastoresClientListSecretsOptions) (resp azfake.Responder[armmachinelearning.DatastoresClientListSecretsResponse], errResp azfake.ErrorResponder) +} + +// NewDatastoresServerTransport creates a new instance of DatastoresServerTransport with the provided implementation. +// The returned DatastoresServerTransport instance is connected to an instance of armmachinelearning.DatastoresClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDatastoresServerTransport(srv *DatastoresServer) *DatastoresServerTransport { + return &DatastoresServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.DatastoresClientListResponse]](), + } +} + +// DatastoresServerTransport connects instances of armmachinelearning.DatastoresClient to instances of DatastoresServer. +// Don't use this type directly, use NewDatastoresServerTransport instead. +type DatastoresServerTransport struct { + srv *DatastoresServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.DatastoresClientListResponse]] +} + +// Do implements the policy.Transporter interface for DatastoresServerTransport. +func (d *DatastoresServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DatastoresClient.CreateOrUpdate": + resp, err = d.dispatchCreateOrUpdate(req) + case "DatastoresClient.Delete": + resp, err = d.dispatchDelete(req) + case "DatastoresClient.Get": + resp, err = d.dispatchGet(req) + case "DatastoresClient.NewListPager": + resp, err = d.dispatchNewListPager(req) + case "DatastoresClient.ListSecrets": + resp, err = d.dispatchListSecrets(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DatastoresServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/datastores/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.Datastore](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + skipValidationUnescaped, err := url.QueryUnescape(qp.Get("skipValidation")) + if err != nil { + return nil, err + } + skipValidationParam, err := parseOptional(skipValidationUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armmachinelearning.DatastoresClientCreateOrUpdateOptions + if skipValidationParam != nil { + options = &armmachinelearning.DatastoresClientCreateOrUpdateOptions{ + SkipValidation: skipValidationParam, + } + } + respr, errRespr := d.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Datastore, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DatastoresServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if d.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/datastores/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DatastoresServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/datastores/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Datastore, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DatastoresServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := d.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/datastores` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + isDefaultUnescaped, err := url.QueryUnescape(qp.Get("isDefault")) + if err != nil { + return nil, err + } + isDefaultParam, err := parseOptional(isDefaultUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + namesUnescaped, err := url.QueryUnescape(qp.Get("names")) + if err != nil { + return nil, err + } + namesParam := splitHelper(namesUnescaped, ",") + searchTextUnescaped, err := url.QueryUnescape(qp.Get("searchText")) + if err != nil { + return nil, err + } + searchTextParam := getOptional(searchTextUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + orderByAscUnescaped, err := url.QueryUnescape(qp.Get("orderByAsc")) + if err != nil { + return nil, err + } + orderByAscParam, err := parseOptional(orderByAscUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armmachinelearning.DatastoresClientListOptions + if skipParam != nil || countParam != nil || isDefaultParam != nil || len(namesParam) > 0 || searchTextParam != nil || orderByParam != nil || orderByAscParam != nil { + options = &armmachinelearning.DatastoresClientListOptions{ + Skip: skipParam, + Count: countParam, + IsDefault: isDefaultParam, + Names: namesParam, + SearchText: searchTextParam, + OrderBy: orderByParam, + OrderByAsc: orderByAscParam, + } + } + resp := d.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.DatastoresClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) + } + return resp, nil +} + +func (d *DatastoresServerTransport) dispatchListSecrets(req *http.Request) (*http.Response, error) { + if d.srv.ListSecrets == nil { + return nil, &nonRetriableError{errors.New("fake for method ListSecrets not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/datastores/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listSecrets` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.ListSecrets(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DatastoreSecretsClassification, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go new file mode 100644 index 000000000000..8fb9b528fce6 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go @@ -0,0 +1,378 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// DataVersionsServer is a fake server for instances of the armmachinelearning.DataVersionsClient type. +type DataVersionsServer struct { + // CreateOrUpdate is the fake for method DataVersionsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.DataVersionBase, options *armmachinelearning.DataVersionsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.DataVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method DataVersionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.DataVersionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.DataVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DataVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.DataVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.DataVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method DataVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.DataVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.DataVersionsClientListResponse]) + + // BeginPublish is the fake for method DataVersionsClient.BeginPublish + // HTTP status codes to indicate success: http.StatusAccepted + BeginPublish func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.DestinationAsset, options *armmachinelearning.DataVersionsClientBeginPublishOptions) (resp azfake.PollerResponder[armmachinelearning.DataVersionsClientPublishResponse], errResp azfake.ErrorResponder) +} + +// NewDataVersionsServerTransport creates a new instance of DataVersionsServerTransport with the provided implementation. +// The returned DataVersionsServerTransport instance is connected to an instance of armmachinelearning.DataVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDataVersionsServerTransport(srv *DataVersionsServer) *DataVersionsServerTransport { + return &DataVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.DataVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.DataVersionsClientPublishResponse]](), + } +} + +// DataVersionsServerTransport connects instances of armmachinelearning.DataVersionsClient to instances of DataVersionsServer. +// Don't use this type directly, use NewDataVersionsServerTransport instead. +type DataVersionsServerTransport struct { + srv *DataVersionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.DataVersionsClientListResponse]] + beginPublish *tracker[azfake.PollerResponder[armmachinelearning.DataVersionsClientPublishResponse]] +} + +// Do implements the policy.Transporter interface for DataVersionsServerTransport. +func (d *DataVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DataVersionsClient.CreateOrUpdate": + resp, err = d.dispatchCreateOrUpdate(req) + case "DataVersionsClient.Delete": + resp, err = d.dispatchDelete(req) + case "DataVersionsClient.Get": + resp, err = d.dispatchGet(req) + case "DataVersionsClient.NewListPager": + resp, err = d.dispatchNewListPager(req) + case "DataVersionsClient.BeginPublish": + resp, err = d.dispatchBeginPublish(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DataVersionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if d.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DataVersionBase](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataVersionBase, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DataVersionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if d.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DataVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataVersionBase, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DataVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := d.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("$tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.DataVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || tagsParam != nil || listViewTypeParam != nil || stageParam != nil { + options = &armmachinelearning.DataVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + Tags: tagsParam, + ListViewType: listViewTypeParam, + Stage: stageParam, + } + } + resp := d.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.DataVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) + } + return resp, nil +} + +func (d *DataVersionsServerTransport) dispatchBeginPublish(req *http.Request) (*http.Response, error) { + if d.srv.BeginPublish == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPublish not implemented")} + } + beginPublish := d.beginPublish.get(req) + if beginPublish == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publish` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DestinationAsset](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.BeginPublish(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPublish = &respr + d.beginPublish.add(req, beginPublish) + } + + resp, err := server.PollerResponderNext(beginPublish, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + d.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPublish) { + d.beginPublish.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentcontainers_server.go new file mode 100644 index 000000000000..0d44e8cb74ff --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentcontainers_server.go @@ -0,0 +1,264 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// EnvironmentContainersServer is a fake server for instances of the armmachinelearning.EnvironmentContainersClient type. +type EnvironmentContainersServer struct { + // CreateOrUpdate is the fake for method EnvironmentContainersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.EnvironmentContainer, options *armmachinelearning.EnvironmentContainersClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.EnvironmentContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method EnvironmentContainersClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.EnvironmentContainersClientDeleteOptions) (resp azfake.Responder[armmachinelearning.EnvironmentContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method EnvironmentContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.EnvironmentContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.EnvironmentContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method EnvironmentContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.EnvironmentContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.EnvironmentContainersClientListResponse]) +} + +// NewEnvironmentContainersServerTransport creates a new instance of EnvironmentContainersServerTransport with the provided implementation. +// The returned EnvironmentContainersServerTransport instance is connected to an instance of armmachinelearning.EnvironmentContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewEnvironmentContainersServerTransport(srv *EnvironmentContainersServer) *EnvironmentContainersServerTransport { + return &EnvironmentContainersServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.EnvironmentContainersClientListResponse]](), + } +} + +// EnvironmentContainersServerTransport connects instances of armmachinelearning.EnvironmentContainersClient to instances of EnvironmentContainersServer. +// Don't use this type directly, use NewEnvironmentContainersServerTransport instead. +type EnvironmentContainersServerTransport struct { + srv *EnvironmentContainersServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.EnvironmentContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for EnvironmentContainersServerTransport. +func (e *EnvironmentContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "EnvironmentContainersClient.CreateOrUpdate": + resp, err = e.dispatchCreateOrUpdate(req) + case "EnvironmentContainersClient.Delete": + resp, err = e.dispatchDelete(req) + case "EnvironmentContainersClient.Get": + resp, err = e.dispatchGet(req) + case "EnvironmentContainersClient.NewListPager": + resp, err = e.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (e *EnvironmentContainersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if e.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.EnvironmentContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EnvironmentContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EnvironmentContainersServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if e.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EnvironmentContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EnvironmentContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EnvironmentContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := e.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.EnvironmentContainersClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.EnvironmentContainersClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := e.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + e.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.EnvironmentContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + e.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go new file mode 100644 index 000000000000..64163fa063ee --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go @@ -0,0 +1,372 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// EnvironmentVersionsServer is a fake server for instances of the armmachinelearning.EnvironmentVersionsClient type. +type EnvironmentVersionsServer struct { + // CreateOrUpdate is the fake for method EnvironmentVersionsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.EnvironmentVersion, options *armmachinelearning.EnvironmentVersionsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.EnvironmentVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method EnvironmentVersionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.EnvironmentVersionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.EnvironmentVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method EnvironmentVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.EnvironmentVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.EnvironmentVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method EnvironmentVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.EnvironmentVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.EnvironmentVersionsClientListResponse]) + + // BeginPublish is the fake for method EnvironmentVersionsClient.BeginPublish + // HTTP status codes to indicate success: http.StatusAccepted + BeginPublish func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.DestinationAsset, options *armmachinelearning.EnvironmentVersionsClientBeginPublishOptions) (resp azfake.PollerResponder[armmachinelearning.EnvironmentVersionsClientPublishResponse], errResp azfake.ErrorResponder) +} + +// NewEnvironmentVersionsServerTransport creates a new instance of EnvironmentVersionsServerTransport with the provided implementation. +// The returned EnvironmentVersionsServerTransport instance is connected to an instance of armmachinelearning.EnvironmentVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewEnvironmentVersionsServerTransport(srv *EnvironmentVersionsServer) *EnvironmentVersionsServerTransport { + return &EnvironmentVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.EnvironmentVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.EnvironmentVersionsClientPublishResponse]](), + } +} + +// EnvironmentVersionsServerTransport connects instances of armmachinelearning.EnvironmentVersionsClient to instances of EnvironmentVersionsServer. +// Don't use this type directly, use NewEnvironmentVersionsServerTransport instead. +type EnvironmentVersionsServerTransport struct { + srv *EnvironmentVersionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.EnvironmentVersionsClientListResponse]] + beginPublish *tracker[azfake.PollerResponder[armmachinelearning.EnvironmentVersionsClientPublishResponse]] +} + +// Do implements the policy.Transporter interface for EnvironmentVersionsServerTransport. +func (e *EnvironmentVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "EnvironmentVersionsClient.CreateOrUpdate": + resp, err = e.dispatchCreateOrUpdate(req) + case "EnvironmentVersionsClient.Delete": + resp, err = e.dispatchDelete(req) + case "EnvironmentVersionsClient.Get": + resp, err = e.dispatchGet(req) + case "EnvironmentVersionsClient.NewListPager": + resp, err = e.dispatchNewListPager(req) + case "EnvironmentVersionsClient.BeginPublish": + resp, err = e.dispatchBeginPublish(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (e *EnvironmentVersionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if e.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.EnvironmentVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EnvironmentVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EnvironmentVersionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if e.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EnvironmentVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EnvironmentVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EnvironmentVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := e.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.EnvironmentVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || listViewTypeParam != nil || stageParam != nil { + options = &armmachinelearning.EnvironmentVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + ListViewType: listViewTypeParam, + Stage: stageParam, + } + } + resp := e.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + e.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.EnvironmentVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + e.newListPager.remove(req) + } + return resp, nil +} + +func (e *EnvironmentVersionsServerTransport) dispatchBeginPublish(req *http.Request) (*http.Response, error) { + if e.srv.BeginPublish == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPublish not implemented")} + } + beginPublish := e.beginPublish.get(req) + if beginPublish == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publish` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DestinationAsset](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginPublish(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPublish = &respr + e.beginPublish.add(req, beginPublish) + } + + resp, err := server.PollerResponderNext(beginPublish, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + e.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPublish) { + e.beginPublish.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/features_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/features_server.go new file mode 100644 index 000000000000..70c4b03c2d83 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/features_server.go @@ -0,0 +1,224 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// FeaturesServer is a fake server for instances of the armmachinelearning.FeaturesClient type. +type FeaturesServer struct { + // Get is the fake for method FeaturesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, featuresetName string, featuresetVersion string, featureName string, options *armmachinelearning.FeaturesClientGetOptions) (resp azfake.Responder[armmachinelearning.FeaturesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method FeaturesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, featuresetName string, featuresetVersion string, options *armmachinelearning.FeaturesClientListOptions) (resp azfake.PagerResponder[armmachinelearning.FeaturesClientListResponse]) +} + +// NewFeaturesServerTransport creates a new instance of FeaturesServerTransport with the provided implementation. +// The returned FeaturesServerTransport instance is connected to an instance of armmachinelearning.FeaturesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFeaturesServerTransport(srv *FeaturesServer) *FeaturesServerTransport { + return &FeaturesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.FeaturesClientListResponse]](), + } +} + +// FeaturesServerTransport connects instances of armmachinelearning.FeaturesClient to instances of FeaturesServer. +// Don't use this type directly, use NewFeaturesServerTransport instead. +type FeaturesServerTransport struct { + srv *FeaturesServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.FeaturesClientListResponse]] +} + +// Do implements the policy.Transporter interface for FeaturesServerTransport. +func (f *FeaturesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FeaturesClient.Get": + resp, err = f.dispatchGet(req) + case "FeaturesClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FeaturesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if f.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/features/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + featuresetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("featuresetName")]) + if err != nil { + return nil, err + } + featuresetVersionParam, err := url.PathUnescape(matches[regex.SubexpIndex("featuresetVersion")]) + if err != nil { + return nil, err + } + featureNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("featureName")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, featuresetNameParam, featuresetVersionParam, featureNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Feature, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FeaturesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/features` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + featuresetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("featuresetName")]) + if err != nil { + return nil, err + } + featuresetVersionParam, err := url.PathUnescape(matches[regex.SubexpIndex("featuresetVersion")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + featureNameUnescaped, err := url.QueryUnescape(qp.Get("featureName")) + if err != nil { + return nil, err + } + featureNameParam := getOptional(featureNameUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + pageSizeUnescaped, err := url.QueryUnescape(qp.Get("pageSize")) + if err != nil { + return nil, err + } + pageSizeParam, err := parseOptional(pageSizeUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + var options *armmachinelearning.FeaturesClientListOptions + if skipParam != nil || tagsParam != nil || featureNameParam != nil || descriptionParam != nil || listViewTypeParam != nil || pageSizeParam != nil { + options = &armmachinelearning.FeaturesClientListOptions{ + Skip: skipParam, + Tags: tagsParam, + FeatureName: featureNameParam, + Description: descriptionParam, + ListViewType: listViewTypeParam, + PageSize: pageSizeParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, featuresetNameParam, featuresetVersionParam, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.FeaturesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetcontainers_server.go new file mode 100644 index 000000000000..ffbd3835cb98 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetcontainers_server.go @@ -0,0 +1,330 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// FeaturesetContainersServer is a fake server for instances of the armmachinelearning.FeaturesetContainersClient type. +type FeaturesetContainersServer struct { + // BeginCreateOrUpdate is the fake for method FeaturesetContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.FeaturesetContainer, options *armmachinelearning.FeaturesetContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturesetContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method FeaturesetContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.FeaturesetContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturesetContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // GetEntity is the fake for method FeaturesetContainersClient.GetEntity + // HTTP status codes to indicate success: http.StatusOK + GetEntity func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.FeaturesetContainersClientGetEntityOptions) (resp azfake.Responder[armmachinelearning.FeaturesetContainersClientGetEntityResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method FeaturesetContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.FeaturesetContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.FeaturesetContainersClientListResponse]) +} + +// NewFeaturesetContainersServerTransport creates a new instance of FeaturesetContainersServerTransport with the provided implementation. +// The returned FeaturesetContainersServerTransport instance is connected to an instance of armmachinelearning.FeaturesetContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFeaturesetContainersServerTransport(srv *FeaturesetContainersServer) *FeaturesetContainersServerTransport { + return &FeaturesetContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.FeaturesetContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.FeaturesetContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.FeaturesetContainersClientListResponse]](), + } +} + +// FeaturesetContainersServerTransport connects instances of armmachinelearning.FeaturesetContainersClient to instances of FeaturesetContainersServer. +// Don't use this type directly, use NewFeaturesetContainersServerTransport instead. +type FeaturesetContainersServerTransport struct { + srv *FeaturesetContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.FeaturesetContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.FeaturesetContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.FeaturesetContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for FeaturesetContainersServerTransport. +func (f *FeaturesetContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FeaturesetContainersClient.BeginCreateOrUpdate": + resp, err = f.dispatchBeginCreateOrUpdate(req) + case "FeaturesetContainersClient.BeginDelete": + resp, err = f.dispatchBeginDelete(req) + case "FeaturesetContainersClient.GetEntity": + resp, err = f.dispatchGetEntity(req) + case "FeaturesetContainersClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FeaturesetContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if f.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := f.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.FeaturesetContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + f.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + f.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + f.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (f *FeaturesetContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if f.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := f.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + f.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + f.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + f.beginDelete.remove(req) + } + + return resp, nil +} + +func (f *FeaturesetContainersServerTransport) dispatchGetEntity(req *http.Request) (*http.Response, error) { + if f.srv.GetEntity == nil { + return nil, &nonRetriableError{errors.New("fake for method GetEntity not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.GetEntity(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FeaturesetContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FeaturesetContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + pageSizeUnescaped, err := url.QueryUnescape(qp.Get("pageSize")) + if err != nil { + return nil, err + } + pageSizeParam, err := parseOptional(pageSizeUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + nameUnescaped, err := url.QueryUnescape(qp.Get("name")) + if err != nil { + return nil, err + } + nameParam := getOptional(nameUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + createdByUnescaped, err := url.QueryUnescape(qp.Get("createdBy")) + if err != nil { + return nil, err + } + createdByParam := getOptional(createdByUnescaped) + var options *armmachinelearning.FeaturesetContainersClientListOptions + if skipParam != nil || tagsParam != nil || listViewTypeParam != nil || pageSizeParam != nil || nameParam != nil || descriptionParam != nil || createdByParam != nil { + options = &armmachinelearning.FeaturesetContainersClientListOptions{ + Skip: skipParam, + Tags: tagsParam, + ListViewType: listViewTypeParam, + PageSize: pageSizeParam, + Name: nameParam, + Description: descriptionParam, + CreatedBy: createdByParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.FeaturesetContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetversions_server.go new file mode 100644 index 000000000000..5277483677f7 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featuresetversions_server.go @@ -0,0 +1,422 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// FeaturesetVersionsServer is a fake server for instances of the armmachinelearning.FeaturesetVersionsClient type. +type FeaturesetVersionsServer struct { + // BeginBackfill is the fake for method FeaturesetVersionsClient.BeginBackfill + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginBackfill func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.FeaturesetVersionBackfillRequest, options *armmachinelearning.FeaturesetVersionsClientBeginBackfillOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientBackfillResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method FeaturesetVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.FeaturesetVersion, options *armmachinelearning.FeaturesetVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method FeaturesetVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.FeaturesetVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method FeaturesetVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.FeaturesetVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.FeaturesetVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method FeaturesetVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.FeaturesetVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.FeaturesetVersionsClientListResponse]) +} + +// NewFeaturesetVersionsServerTransport creates a new instance of FeaturesetVersionsServerTransport with the provided implementation. +// The returned FeaturesetVersionsServerTransport instance is connected to an instance of armmachinelearning.FeaturesetVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFeaturesetVersionsServerTransport(srv *FeaturesetVersionsServer) *FeaturesetVersionsServerTransport { + return &FeaturesetVersionsServerTransport{ + srv: srv, + beginBackfill: newTracker[azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientBackfillResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.FeaturesetVersionsClientListResponse]](), + } +} + +// FeaturesetVersionsServerTransport connects instances of armmachinelearning.FeaturesetVersionsClient to instances of FeaturesetVersionsServer. +// Don't use this type directly, use NewFeaturesetVersionsServerTransport instead. +type FeaturesetVersionsServerTransport struct { + srv *FeaturesetVersionsServer + beginBackfill *tracker[azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientBackfillResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.FeaturesetVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.FeaturesetVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for FeaturesetVersionsServerTransport. +func (f *FeaturesetVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FeaturesetVersionsClient.BeginBackfill": + resp, err = f.dispatchBeginBackfill(req) + case "FeaturesetVersionsClient.BeginCreateOrUpdate": + resp, err = f.dispatchBeginCreateOrUpdate(req) + case "FeaturesetVersionsClient.BeginDelete": + resp, err = f.dispatchBeginDelete(req) + case "FeaturesetVersionsClient.Get": + resp, err = f.dispatchGet(req) + case "FeaturesetVersionsClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FeaturesetVersionsServerTransport) dispatchBeginBackfill(req *http.Request) (*http.Response, error) { + if f.srv.BeginBackfill == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginBackfill not implemented")} + } + beginBackfill := f.beginBackfill.get(req) + if beginBackfill == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backfill` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.FeaturesetVersionBackfillRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginBackfill(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginBackfill = &respr + f.beginBackfill.add(req, beginBackfill) + } + + resp, err := server.PollerResponderNext(beginBackfill, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + f.beginBackfill.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginBackfill) { + f.beginBackfill.remove(req) + } + + return resp, nil +} + +func (f *FeaturesetVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if f.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := f.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.FeaturesetVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + f.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + f.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + f.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (f *FeaturesetVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if f.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := f.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + f.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + f.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + f.beginDelete.remove(req) + } + + return resp, nil +} + +func (f *FeaturesetVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if f.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FeaturesetVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FeaturesetVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featuresets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + pageSizeUnescaped, err := url.QueryUnescape(qp.Get("pageSize")) + if err != nil { + return nil, err + } + pageSizeParam, err := parseOptional(pageSizeUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + versionNameUnescaped, err := url.QueryUnescape(qp.Get("versionName")) + if err != nil { + return nil, err + } + versionNameParam := getOptional(versionNameUnescaped) + versionUnescaped, err := url.QueryUnescape(qp.Get("version")) + if err != nil { + return nil, err + } + versionParam := getOptional(versionUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + createdByUnescaped, err := url.QueryUnescape(qp.Get("createdBy")) + if err != nil { + return nil, err + } + createdByParam := getOptional(createdByUnescaped) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.FeaturesetVersionsClientListOptions + if skipParam != nil || tagsParam != nil || listViewTypeParam != nil || pageSizeParam != nil || versionNameParam != nil || versionParam != nil || descriptionParam != nil || createdByParam != nil || stageParam != nil { + options = &armmachinelearning.FeaturesetVersionsClientListOptions{ + Skip: skipParam, + Tags: tagsParam, + ListViewType: listViewTypeParam, + PageSize: pageSizeParam, + VersionName: versionNameParam, + Version: versionParam, + Description: descriptionParam, + CreatedBy: createdByParam, + Stage: stageParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.FeaturesetVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentitycontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentitycontainers_server.go new file mode 100644 index 000000000000..74474d9cf14b --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentitycontainers_server.go @@ -0,0 +1,330 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// FeaturestoreEntityContainersServer is a fake server for instances of the armmachinelearning.FeaturestoreEntityContainersClient type. +type FeaturestoreEntityContainersServer struct { + // BeginCreateOrUpdate is the fake for method FeaturestoreEntityContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.FeaturestoreEntityContainer, options *armmachinelearning.FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturestoreEntityContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method FeaturestoreEntityContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.FeaturestoreEntityContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturestoreEntityContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // GetEntity is the fake for method FeaturestoreEntityContainersClient.GetEntity + // HTTP status codes to indicate success: http.StatusOK + GetEntity func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.FeaturestoreEntityContainersClientGetEntityOptions) (resp azfake.Responder[armmachinelearning.FeaturestoreEntityContainersClientGetEntityResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method FeaturestoreEntityContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.FeaturestoreEntityContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.FeaturestoreEntityContainersClientListResponse]) +} + +// NewFeaturestoreEntityContainersServerTransport creates a new instance of FeaturestoreEntityContainersServerTransport with the provided implementation. +// The returned FeaturestoreEntityContainersServerTransport instance is connected to an instance of armmachinelearning.FeaturestoreEntityContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFeaturestoreEntityContainersServerTransport(srv *FeaturestoreEntityContainersServer) *FeaturestoreEntityContainersServerTransport { + return &FeaturestoreEntityContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.FeaturestoreEntityContainersClientListResponse]](), + } +} + +// FeaturestoreEntityContainersServerTransport connects instances of armmachinelearning.FeaturestoreEntityContainersClient to instances of FeaturestoreEntityContainersServer. +// Don't use this type directly, use NewFeaturestoreEntityContainersServerTransport instead. +type FeaturestoreEntityContainersServerTransport struct { + srv *FeaturestoreEntityContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.FeaturestoreEntityContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for FeaturestoreEntityContainersServerTransport. +func (f *FeaturestoreEntityContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FeaturestoreEntityContainersClient.BeginCreateOrUpdate": + resp, err = f.dispatchBeginCreateOrUpdate(req) + case "FeaturestoreEntityContainersClient.BeginDelete": + resp, err = f.dispatchBeginDelete(req) + case "FeaturestoreEntityContainersClient.GetEntity": + resp, err = f.dispatchGetEntity(req) + case "FeaturestoreEntityContainersClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FeaturestoreEntityContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if f.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := f.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.FeaturestoreEntityContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + f.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + f.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + f.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (f *FeaturestoreEntityContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if f.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := f.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + f.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + f.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + f.beginDelete.remove(req) + } + + return resp, nil +} + +func (f *FeaturestoreEntityContainersServerTransport) dispatchGetEntity(req *http.Request) (*http.Response, error) { + if f.srv.GetEntity == nil { + return nil, &nonRetriableError{errors.New("fake for method GetEntity not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.GetEntity(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FeaturestoreEntityContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FeaturestoreEntityContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + pageSizeUnescaped, err := url.QueryUnescape(qp.Get("pageSize")) + if err != nil { + return nil, err + } + pageSizeParam, err := parseOptional(pageSizeUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + nameUnescaped, err := url.QueryUnescape(qp.Get("name")) + if err != nil { + return nil, err + } + nameParam := getOptional(nameUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + createdByUnescaped, err := url.QueryUnescape(qp.Get("createdBy")) + if err != nil { + return nil, err + } + createdByParam := getOptional(createdByUnescaped) + var options *armmachinelearning.FeaturestoreEntityContainersClientListOptions + if skipParam != nil || tagsParam != nil || listViewTypeParam != nil || pageSizeParam != nil || nameParam != nil || descriptionParam != nil || createdByParam != nil { + options = &armmachinelearning.FeaturestoreEntityContainersClientListOptions{ + Skip: skipParam, + Tags: tagsParam, + ListViewType: listViewTypeParam, + PageSize: pageSizeParam, + Name: nameParam, + Description: descriptionParam, + CreatedBy: createdByParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.FeaturestoreEntityContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentityversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentityversions_server.go new file mode 100644 index 000000000000..694fef31c5e7 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/featurestoreentityversions_server.go @@ -0,0 +1,358 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// FeaturestoreEntityVersionsServer is a fake server for instances of the armmachinelearning.FeaturestoreEntityVersionsClient type. +type FeaturestoreEntityVersionsServer struct { + // BeginCreateOrUpdate is the fake for method FeaturestoreEntityVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.FeaturestoreEntityVersion, options *armmachinelearning.FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturestoreEntityVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method FeaturestoreEntityVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.FeaturestoreEntityVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.FeaturestoreEntityVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method FeaturestoreEntityVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.FeaturestoreEntityVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.FeaturestoreEntityVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method FeaturestoreEntityVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.FeaturestoreEntityVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.FeaturestoreEntityVersionsClientListResponse]) +} + +// NewFeaturestoreEntityVersionsServerTransport creates a new instance of FeaturestoreEntityVersionsServerTransport with the provided implementation. +// The returned FeaturestoreEntityVersionsServerTransport instance is connected to an instance of armmachinelearning.FeaturestoreEntityVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFeaturestoreEntityVersionsServerTransport(srv *FeaturestoreEntityVersionsServer) *FeaturestoreEntityVersionsServerTransport { + return &FeaturestoreEntityVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.FeaturestoreEntityVersionsClientListResponse]](), + } +} + +// FeaturestoreEntityVersionsServerTransport connects instances of armmachinelearning.FeaturestoreEntityVersionsClient to instances of FeaturestoreEntityVersionsServer. +// Don't use this type directly, use NewFeaturestoreEntityVersionsServerTransport instead. +type FeaturestoreEntityVersionsServerTransport struct { + srv *FeaturestoreEntityVersionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.FeaturestoreEntityVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.FeaturestoreEntityVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for FeaturestoreEntityVersionsServerTransport. +func (f *FeaturestoreEntityVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FeaturestoreEntityVersionsClient.BeginCreateOrUpdate": + resp, err = f.dispatchBeginCreateOrUpdate(req) + case "FeaturestoreEntityVersionsClient.BeginDelete": + resp, err = f.dispatchBeginDelete(req) + case "FeaturestoreEntityVersionsClient.Get": + resp, err = f.dispatchGet(req) + case "FeaturestoreEntityVersionsClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FeaturestoreEntityVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if f.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := f.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.FeaturestoreEntityVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + f.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + f.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + f.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (f *FeaturestoreEntityVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if f.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := f.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + f.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + f.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + f.beginDelete.remove(req) + } + + return resp, nil +} + +func (f *FeaturestoreEntityVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if f.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FeaturestoreEntityVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FeaturestoreEntityVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/featurestoreEntities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + pageSizeUnescaped, err := url.QueryUnescape(qp.Get("pageSize")) + if err != nil { + return nil, err + } + pageSizeParam, err := parseOptional(pageSizeUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + versionNameUnescaped, err := url.QueryUnescape(qp.Get("versionName")) + if err != nil { + return nil, err + } + versionNameParam := getOptional(versionNameUnescaped) + versionUnescaped, err := url.QueryUnescape(qp.Get("version")) + if err != nil { + return nil, err + } + versionParam := getOptional(versionUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + createdByUnescaped, err := url.QueryUnescape(qp.Get("createdBy")) + if err != nil { + return nil, err + } + createdByParam := getOptional(createdByUnescaped) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.FeaturestoreEntityVersionsClientListOptions + if skipParam != nil || tagsParam != nil || listViewTypeParam != nil || pageSizeParam != nil || versionNameParam != nil || versionParam != nil || descriptionParam != nil || createdByParam != nil || stageParam != nil { + options = &armmachinelearning.FeaturestoreEntityVersionsClientListOptions{ + Skip: skipParam, + Tags: tagsParam, + ListViewType: listViewTypeParam, + PageSize: pageSizeParam, + VersionName: versionNameParam, + Version: versionParam, + Description: descriptionParam, + CreatedBy: createdByParam, + Stage: stageParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.FeaturestoreEntityVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferenceendpoints_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferenceendpoints_server.go new file mode 100644 index 000000000000..ed10c7d25811 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferenceendpoints_server.go @@ -0,0 +1,398 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// InferenceEndpointsServer is a fake server for instances of the armmachinelearning.InferenceEndpointsClient type. +type InferenceEndpointsServer struct { + // BeginCreateOrUpdate is the fake for method InferenceEndpointsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body armmachinelearning.InferenceEndpoint, options *armmachinelearning.InferenceEndpointsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method InferenceEndpointsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *armmachinelearning.InferenceEndpointsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method InferenceEndpointsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *armmachinelearning.InferenceEndpointsClientGetOptions) (resp azfake.Responder[armmachinelearning.InferenceEndpointsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method InferenceEndpointsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, poolName string, options *armmachinelearning.InferenceEndpointsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.InferenceEndpointsClientListResponse]) + + // BeginUpdate is the fake for method InferenceEndpointsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body any, options *armmachinelearning.InferenceEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewInferenceEndpointsServerTransport creates a new instance of InferenceEndpointsServerTransport with the provided implementation. +// The returned InferenceEndpointsServerTransport instance is connected to an instance of armmachinelearning.InferenceEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewInferenceEndpointsServerTransport(srv *InferenceEndpointsServer) *InferenceEndpointsServerTransport { + return &InferenceEndpointsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.InferenceEndpointsClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientUpdateResponse]](), + } +} + +// InferenceEndpointsServerTransport connects instances of armmachinelearning.InferenceEndpointsClient to instances of InferenceEndpointsServer. +// Don't use this type directly, use NewInferenceEndpointsServerTransport instead. +type InferenceEndpointsServerTransport struct { + srv *InferenceEndpointsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.InferenceEndpointsClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.InferenceEndpointsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for InferenceEndpointsServerTransport. +func (i *InferenceEndpointsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "InferenceEndpointsClient.BeginCreateOrUpdate": + resp, err = i.dispatchBeginCreateOrUpdate(req) + case "InferenceEndpointsClient.BeginDelete": + resp, err = i.dispatchBeginDelete(req) + case "InferenceEndpointsClient.Get": + resp, err = i.dispatchGet(req) + case "InferenceEndpointsClient.NewListPager": + resp, err = i.dispatchNewListPager(req) + case "InferenceEndpointsClient.BeginUpdate": + resp, err = i.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (i *InferenceEndpointsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := i.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.InferenceEndpoint](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + i.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + i.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + i.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (i *InferenceEndpointsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if i.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := i.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + i.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + i.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + i.beginDelete.remove(req) + } + + return resp, nil +} + +func (i *InferenceEndpointsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if i.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InferenceEndpoint, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InferenceEndpointsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := i.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endpoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(armmachinelearning.OrderString(orderByUnescaped)) + var options *armmachinelearning.InferenceEndpointsClientListOptions + if countParam != nil || skipParam != nil || tagsParam != nil || propertiesParam != nil || orderByParam != nil { + options = &armmachinelearning.InferenceEndpointsClientListOptions{ + Count: countParam, + Skip: skipParam, + Tags: tagsParam, + Properties: propertiesParam, + OrderBy: orderByParam, + } + } + resp := i.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, poolNameParam, options) + newListPager = &resp + i.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.InferenceEndpointsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + i.newListPager.remove(req) + } + return resp, nil +} + +func (i *InferenceEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := i.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[any](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + i.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + i.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + i.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencegroups_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencegroups_server.go new file mode 100644 index 000000000000..564161c71556 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencegroups_server.go @@ -0,0 +1,529 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// InferenceGroupsServer is a fake server for instances of the armmachinelearning.InferenceGroupsClient type. +type InferenceGroupsServer struct { + // BeginCreateOrUpdate is the fake for method InferenceGroupsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body armmachinelearning.InferenceGroup, options *armmachinelearning.InferenceGroupsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.InferenceGroupsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method InferenceGroupsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *armmachinelearning.InferenceGroupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.InferenceGroupsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method InferenceGroupsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *armmachinelearning.InferenceGroupsClientGetOptions) (resp azfake.Responder[armmachinelearning.InferenceGroupsClientGetResponse], errResp azfake.ErrorResponder) + + // GetStatus is the fake for method InferenceGroupsClient.GetStatus + // HTTP status codes to indicate success: http.StatusOK + GetStatus func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *armmachinelearning.InferenceGroupsClientGetStatusOptions) (resp azfake.Responder[armmachinelearning.InferenceGroupsClientGetStatusResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method InferenceGroupsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, poolName string, options *armmachinelearning.InferenceGroupsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.InferenceGroupsClientListResponse]) + + // NewListSKUsPager is the fake for method InferenceGroupsClient.NewListSKUsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSKUsPager func(resourceGroupName string, workspaceName string, poolName string, groupName string, options *armmachinelearning.InferenceGroupsClientListSKUsOptions) (resp azfake.PagerResponder[armmachinelearning.InferenceGroupsClientListSKUsResponse]) + + // BeginUpdate is the fake for method InferenceGroupsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body armmachinelearning.PartialMinimalTrackedResourceWithSKU, options *armmachinelearning.InferenceGroupsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.InferenceGroupsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewInferenceGroupsServerTransport creates a new instance of InferenceGroupsServerTransport with the provided implementation. +// The returned InferenceGroupsServerTransport instance is connected to an instance of armmachinelearning.InferenceGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewInferenceGroupsServerTransport(srv *InferenceGroupsServer) *InferenceGroupsServerTransport { + return &InferenceGroupsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.InferenceGroupsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.InferenceGroupsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.InferenceGroupsClientListResponse]](), + newListSKUsPager: newTracker[azfake.PagerResponder[armmachinelearning.InferenceGroupsClientListSKUsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.InferenceGroupsClientUpdateResponse]](), + } +} + +// InferenceGroupsServerTransport connects instances of armmachinelearning.InferenceGroupsClient to instances of InferenceGroupsServer. +// Don't use this type directly, use NewInferenceGroupsServerTransport instead. +type InferenceGroupsServerTransport struct { + srv *InferenceGroupsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.InferenceGroupsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.InferenceGroupsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.InferenceGroupsClientListResponse]] + newListSKUsPager *tracker[azfake.PagerResponder[armmachinelearning.InferenceGroupsClientListSKUsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.InferenceGroupsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for InferenceGroupsServerTransport. +func (i *InferenceGroupsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "InferenceGroupsClient.BeginCreateOrUpdate": + resp, err = i.dispatchBeginCreateOrUpdate(req) + case "InferenceGroupsClient.BeginDelete": + resp, err = i.dispatchBeginDelete(req) + case "InferenceGroupsClient.Get": + resp, err = i.dispatchGet(req) + case "InferenceGroupsClient.GetStatus": + resp, err = i.dispatchGetStatus(req) + case "InferenceGroupsClient.NewListPager": + resp, err = i.dispatchNewListPager(req) + case "InferenceGroupsClient.NewListSKUsPager": + resp, err = i.dispatchNewListSKUsPager(req) + case "InferenceGroupsClient.BeginUpdate": + resp, err = i.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := i.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.InferenceGroup](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, groupNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + i.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + i.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + i.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if i.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := i.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, groupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + i.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + i.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + i.beginDelete.remove(req) + } + + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if i.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, groupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InferenceGroup, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchGetStatus(req *http.Request) (*http.Response, error) { + if i.srv.GetStatus == nil { + return nil, &nonRetriableError{errors.New("fake for method GetStatus not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getStatus` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.GetStatus(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, groupNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GroupStatus, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := i.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(armmachinelearning.OrderString(orderByUnescaped)) + var options *armmachinelearning.InferenceGroupsClientListOptions + if countParam != nil || skipParam != nil || tagsParam != nil || propertiesParam != nil || orderByParam != nil { + options = &armmachinelearning.InferenceGroupsClientListOptions{ + Count: countParam, + Skip: skipParam, + Tags: tagsParam, + Properties: propertiesParam, + OrderBy: orderByParam, + } + } + resp := i.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, poolNameParam, options) + newListPager = &resp + i.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.InferenceGroupsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + i.newListPager.remove(req) + } + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchNewListSKUsPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListSKUsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSKUsPager not implemented")} + } + newListSKUsPager := i.newListSKUsPager.get(req) + if newListSKUsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.InferenceGroupsClientListSKUsOptions + if countParam != nil || skipParam != nil { + options = &armmachinelearning.InferenceGroupsClientListSKUsOptions{ + Count: countParam, + Skip: skipParam, + } + } + resp := i.srv.NewListSKUsPager(resourceGroupNameParam, workspaceNameParam, poolNameParam, groupNameParam, options) + newListSKUsPager = &resp + i.newListSKUsPager.add(req, newListSKUsPager) + server.PagerResponderInjectNextLinks(newListSKUsPager, req, func(page *armmachinelearning.InferenceGroupsClientListSKUsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSKUsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListSKUsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSKUsPager) { + i.newListSKUsPager.remove(req) + } + return resp, nil +} + +func (i *InferenceGroupsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := i.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/groups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithSKU](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) + if err != nil { + return nil, err + } + groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, poolNameParam, groupNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + i.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + i.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + i.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencepools_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencepools_server.go new file mode 100644 index 000000000000..e19e6395b27f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/inferencepools_server.go @@ -0,0 +1,501 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// InferencePoolsServer is a fake server for instances of the armmachinelearning.InferencePoolsClient type. +type InferencePoolsServer struct { + // BeginCreateOrUpdate is the fake for method InferencePoolsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body armmachinelearning.InferencePool, options *armmachinelearning.InferencePoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.InferencePoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method InferencePoolsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *armmachinelearning.InferencePoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.InferencePoolsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method InferencePoolsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *armmachinelearning.InferencePoolsClientGetOptions) (resp azfake.Responder[armmachinelearning.InferencePoolsClientGetResponse], errResp azfake.ErrorResponder) + + // GetStatus is the fake for method InferencePoolsClient.GetStatus + // HTTP status codes to indicate success: http.StatusOK + GetStatus func(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *armmachinelearning.InferencePoolsClientGetStatusOptions) (resp azfake.Responder[armmachinelearning.InferencePoolsClientGetStatusResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method InferencePoolsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.InferencePoolsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.InferencePoolsClientListResponse]) + + // NewListSKUsPager is the fake for method InferencePoolsClient.NewListSKUsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSKUsPager func(resourceGroupName string, workspaceName string, inferencePoolName string, options *armmachinelearning.InferencePoolsClientListSKUsOptions) (resp azfake.PagerResponder[armmachinelearning.InferencePoolsClientListSKUsResponse]) + + // BeginUpdate is the fake for method InferencePoolsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body armmachinelearning.PartialMinimalTrackedResourceWithSKUAndIdentity, options *armmachinelearning.InferencePoolsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.InferencePoolsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewInferencePoolsServerTransport creates a new instance of InferencePoolsServerTransport with the provided implementation. +// The returned InferencePoolsServerTransport instance is connected to an instance of armmachinelearning.InferencePoolsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewInferencePoolsServerTransport(srv *InferencePoolsServer) *InferencePoolsServerTransport { + return &InferencePoolsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.InferencePoolsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.InferencePoolsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.InferencePoolsClientListResponse]](), + newListSKUsPager: newTracker[azfake.PagerResponder[armmachinelearning.InferencePoolsClientListSKUsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.InferencePoolsClientUpdateResponse]](), + } +} + +// InferencePoolsServerTransport connects instances of armmachinelearning.InferencePoolsClient to instances of InferencePoolsServer. +// Don't use this type directly, use NewInferencePoolsServerTransport instead. +type InferencePoolsServerTransport struct { + srv *InferencePoolsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.InferencePoolsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.InferencePoolsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.InferencePoolsClientListResponse]] + newListSKUsPager *tracker[azfake.PagerResponder[armmachinelearning.InferencePoolsClientListSKUsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.InferencePoolsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for InferencePoolsServerTransport. +func (i *InferencePoolsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "InferencePoolsClient.BeginCreateOrUpdate": + resp, err = i.dispatchBeginCreateOrUpdate(req) + case "InferencePoolsClient.BeginDelete": + resp, err = i.dispatchBeginDelete(req) + case "InferencePoolsClient.Get": + resp, err = i.dispatchGet(req) + case "InferencePoolsClient.GetStatus": + resp, err = i.dispatchGetStatus(req) + case "InferencePoolsClient.NewListPager": + resp, err = i.dispatchNewListPager(req) + case "InferencePoolsClient.NewListSKUsPager": + resp, err = i.dispatchNewListSKUsPager(req) + case "InferencePoolsClient.BeginUpdate": + resp, err = i.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := i.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.InferencePool](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + inferencePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inferencePoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, inferencePoolNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + i.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + i.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + i.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if i.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := i.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + inferencePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inferencePoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, inferencePoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + i.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + i.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + i.beginDelete.remove(req) + } + + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if i.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + inferencePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inferencePoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, inferencePoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).InferencePool, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchGetStatus(req *http.Request) (*http.Response, error) { + if i.srv.GetStatus == nil { + return nil, &nonRetriableError{errors.New("fake for method GetStatus not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getStatus` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + inferencePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inferencePoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.GetStatus(req.Context(), resourceGroupNameParam, workspaceNameParam, inferencePoolNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PoolStatus, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := i.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(armmachinelearning.OrderString(orderByUnescaped)) + var options *armmachinelearning.InferencePoolsClientListOptions + if countParam != nil || skipParam != nil || tagsParam != nil || propertiesParam != nil || orderByParam != nil { + options = &armmachinelearning.InferencePoolsClientListOptions{ + Count: countParam, + Skip: skipParam, + Tags: tagsParam, + Properties: propertiesParam, + OrderBy: orderByParam, + } + } + resp := i.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + i.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.InferencePoolsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + i.newListPager.remove(req) + } + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchNewListSKUsPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListSKUsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSKUsPager not implemented")} + } + newListSKUsPager := i.newListSKUsPager.get(req) + if newListSKUsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + inferencePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inferencePoolName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.InferencePoolsClientListSKUsOptions + if countParam != nil || skipParam != nil { + options = &armmachinelearning.InferencePoolsClientListSKUsOptions{ + Count: countParam, + Skip: skipParam, + } + } + resp := i.srv.NewListSKUsPager(resourceGroupNameParam, workspaceNameParam, inferencePoolNameParam, options) + newListSKUsPager = &resp + i.newListSKUsPager.add(req, newListSKUsPager) + server.PagerResponderInjectNextLinks(newListSKUsPager, req, func(page *armmachinelearning.InferencePoolsClientListSKUsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSKUsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListSKUsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSKUsPager) { + i.newListSKUsPager.remove(req) + } + return resp, nil +} + +func (i *InferencePoolsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if i.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := i.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inferencePools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithSKUAndIdentity](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + inferencePoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inferencePoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, inferencePoolNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + i.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + i.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + i.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/internal.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/internal.go new file mode 100644 index 000000000000..e54cbfe30891 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/internal.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "io" + "net/http" + "reflect" + "strings" + "sync" +) + +type nonRetriableError struct { + error +} + +func (nonRetriableError) NonRetriable() { + // marker method +} + +func contains[T comparable](s []T, v T) bool { + for _, vv := range s { + if vv == v { + return true + } + } + return false +} + +func getOptional[T any](v T) *T { + if reflect.ValueOf(v).IsZero() { + return nil + } + return &v +} + +func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { + if v == "" { + return nil, nil + } + t, err := parse(v) + if err != nil { + return nil, err + } + return &t, err +} + +func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { + t, err := parse(v) + if err != nil { + return *new(T), err + } + return t, err +} + +func readRequestBody(req *http.Request) ([]byte, error) { + if req.Body == nil { + return nil, nil + } + body, err := io.ReadAll(req.Body) + if err != nil { + return nil, err + } + req.Body.Close() + return body, nil +} + +func splitHelper(s, sep string) []string { + if s == "" { + return nil + } + return strings.Split(s, sep) +} + +func newTracker[T any]() *tracker[T] { + return &tracker[T]{ + items: map[string]*T{}, + } +} + +type tracker[T any] struct { + items map[string]*T + mu sync.Mutex +} + +func (p *tracker[T]) get(req *http.Request) *T { + p.mu.Lock() + defer p.mu.Unlock() + if item, ok := p.items[server.SanitizePagerPollerPath(req.URL.Path)]; ok { + return item + } + return nil +} + +func (p *tracker[T]) add(req *http.Request, item *T) { + p.mu.Lock() + defer p.mu.Unlock() + p.items[server.SanitizePagerPollerPath(req.URL.Path)] = item +} + +func (p *tracker[T]) remove(req *http.Request) { + p.mu.Lock() + defer p.mu.Unlock() + delete(p.items, server.SanitizePagerPollerPath(req.URL.Path)) +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go new file mode 100644 index 000000000000..7e9020b22569 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go @@ -0,0 +1,420 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// JobsServer is a fake server for instances of the armmachinelearning.JobsClient type. +type JobsServer struct { + // BeginCancel is the fake for method JobsClient.BeginCancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCancel func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.JobsClientBeginCancelOptions) (resp azfake.PollerResponder[armmachinelearning.JobsClientCancelResponse], errResp azfake.ErrorResponder) + + // CreateOrUpdate is the fake for method JobsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, id string, body armmachinelearning.JobBase, options *armmachinelearning.JobsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.JobsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method JobsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.JobsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.JobsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method JobsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.JobsClientGetOptions) (resp azfake.Responder[armmachinelearning.JobsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method JobsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.JobsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.JobsClientListResponse]) + + // Update is the fake for method JobsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, workspaceName string, id string, body armmachinelearning.PartialJobBasePartialResource, options *armmachinelearning.JobsClientUpdateOptions) (resp azfake.Responder[armmachinelearning.JobsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewJobsServerTransport creates a new instance of JobsServerTransport with the provided implementation. +// The returned JobsServerTransport instance is connected to an instance of armmachinelearning.JobsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewJobsServerTransport(srv *JobsServer) *JobsServerTransport { + return &JobsServerTransport{ + srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armmachinelearning.JobsClientCancelResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.JobsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.JobsClientListResponse]](), + } +} + +// JobsServerTransport connects instances of armmachinelearning.JobsClient to instances of JobsServer. +// Don't use this type directly, use NewJobsServerTransport instead. +type JobsServerTransport struct { + srv *JobsServer + beginCancel *tracker[azfake.PollerResponder[armmachinelearning.JobsClientCancelResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.JobsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.JobsClientListResponse]] +} + +// Do implements the policy.Transporter interface for JobsServerTransport. +func (j *JobsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "JobsClient.BeginCancel": + resp, err = j.dispatchBeginCancel(req) + case "JobsClient.CreateOrUpdate": + resp, err = j.dispatchCreateOrUpdate(req) + case "JobsClient.BeginDelete": + resp, err = j.dispatchBeginDelete(req) + case "JobsClient.Get": + resp, err = j.dispatchGet(req) + case "JobsClient.NewListPager": + resp, err = j.dispatchNewListPager(req) + case "JobsClient.Update": + resp, err = j.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (j *JobsServerTransport) dispatchBeginCancel(req *http.Request) (*http.Response, error) { + if j.srv.BeginCancel == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} + } + beginCancel := j.beginCancel.get(req) + if beginCancel == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := j.srv.BeginCancel(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCancel = &respr + j.beginCancel.add(req, beginCancel) + } + + resp, err := server.PollerResponderNext(beginCancel, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + j.beginCancel.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCancel) { + j.beginCancel.remove(req) + } + + return resp, nil +} + +func (j *JobsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if j.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.JobBase](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := j.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).JobBase, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (j *JobsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if j.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := j.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := j.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + j.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + j.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + j.beginDelete.remove(req) + } + + return resp, nil +} + +func (j *JobsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if j.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := j.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).JobBase, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (j *JobsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if j.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := j.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + jobTypeUnescaped, err := url.QueryUnescape(qp.Get("jobType")) + if err != nil { + return nil, err + } + jobTypeParam := getOptional(jobTypeUnescaped) + tagUnescaped, err := url.QueryUnescape(qp.Get("tag")) + if err != nil { + return nil, err + } + tagParam := getOptional(tagUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + assetNameUnescaped, err := url.QueryUnescape(qp.Get("assetName")) + if err != nil { + return nil, err + } + assetNameParam := getOptional(assetNameUnescaped) + scheduledUnescaped, err := url.QueryUnescape(qp.Get("scheduled")) + if err != nil { + return nil, err + } + scheduledParam, err := parseOptional(scheduledUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + scheduleIDUnescaped, err := url.QueryUnescape(qp.Get("scheduleId")) + if err != nil { + return nil, err + } + scheduleIDParam := getOptional(scheduleIDUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + var options *armmachinelearning.JobsClientListOptions + if skipParam != nil || jobTypeParam != nil || tagParam != nil || listViewTypeParam != nil || assetNameParam != nil || scheduledParam != nil || scheduleIDParam != nil || propertiesParam != nil { + options = &armmachinelearning.JobsClientListOptions{ + Skip: skipParam, + JobType: jobTypeParam, + Tag: tagParam, + ListViewType: listViewTypeParam, + AssetName: assetNameParam, + Scheduled: scheduledParam, + ScheduleID: scheduleIDParam, + Properties: propertiesParam, + } + } + resp := j.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + j.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.JobsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + j.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + j.newListPager.remove(req) + } + return resp, nil +} + +func (j *JobsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if j.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialJobBasePartialResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := j.srv.Update(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).JobBase, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/labelingjobs_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/labelingjobs_server.go new file mode 100644 index 000000000000..9e4db36c6872 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/labelingjobs_server.go @@ -0,0 +1,450 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// LabelingJobsServer is a fake server for instances of the armmachinelearning.LabelingJobsClient type. +type LabelingJobsServer struct { + // BeginCreateOrUpdate is the fake for method LabelingJobsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, id string, body armmachinelearning.LabelingJob, options *armmachinelearning.LabelingJobsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.LabelingJobsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method LabelingJobsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.LabelingJobsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.LabelingJobsClientDeleteResponse], errResp azfake.ErrorResponder) + + // BeginExportLabels is the fake for method LabelingJobsClient.BeginExportLabels + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginExportLabels func(ctx context.Context, resourceGroupName string, workspaceName string, id string, body armmachinelearning.ExportSummaryClassification, options *armmachinelearning.LabelingJobsClientBeginExportLabelsOptions) (resp azfake.PollerResponder[armmachinelearning.LabelingJobsClientExportLabelsResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method LabelingJobsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.LabelingJobsClientGetOptions) (resp azfake.Responder[armmachinelearning.LabelingJobsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method LabelingJobsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.LabelingJobsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.LabelingJobsClientListResponse]) + + // Pause is the fake for method LabelingJobsClient.Pause + // HTTP status codes to indicate success: http.StatusOK + Pause func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.LabelingJobsClientPauseOptions) (resp azfake.Responder[armmachinelearning.LabelingJobsClientPauseResponse], errResp azfake.ErrorResponder) + + // BeginResume is the fake for method LabelingJobsClient.BeginResume + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginResume func(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *armmachinelearning.LabelingJobsClientBeginResumeOptions) (resp azfake.PollerResponder[armmachinelearning.LabelingJobsClientResumeResponse], errResp azfake.ErrorResponder) +} + +// NewLabelingJobsServerTransport creates a new instance of LabelingJobsServerTransport with the provided implementation. +// The returned LabelingJobsServerTransport instance is connected to an instance of armmachinelearning.LabelingJobsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLabelingJobsServerTransport(srv *LabelingJobsServer) *LabelingJobsServerTransport { + return &LabelingJobsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.LabelingJobsClientCreateOrUpdateResponse]](), + beginExportLabels: newTracker[azfake.PollerResponder[armmachinelearning.LabelingJobsClientExportLabelsResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.LabelingJobsClientListResponse]](), + beginResume: newTracker[azfake.PollerResponder[armmachinelearning.LabelingJobsClientResumeResponse]](), + } +} + +// LabelingJobsServerTransport connects instances of armmachinelearning.LabelingJobsClient to instances of LabelingJobsServer. +// Don't use this type directly, use NewLabelingJobsServerTransport instead. +type LabelingJobsServerTransport struct { + srv *LabelingJobsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.LabelingJobsClientCreateOrUpdateResponse]] + beginExportLabels *tracker[azfake.PollerResponder[armmachinelearning.LabelingJobsClientExportLabelsResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.LabelingJobsClientListResponse]] + beginResume *tracker[azfake.PollerResponder[armmachinelearning.LabelingJobsClientResumeResponse]] +} + +// Do implements the policy.Transporter interface for LabelingJobsServerTransport. +func (l *LabelingJobsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "LabelingJobsClient.BeginCreateOrUpdate": + resp, err = l.dispatchBeginCreateOrUpdate(req) + case "LabelingJobsClient.Delete": + resp, err = l.dispatchDelete(req) + case "LabelingJobsClient.BeginExportLabels": + resp, err = l.dispatchBeginExportLabels(req) + case "LabelingJobsClient.Get": + resp, err = l.dispatchGet(req) + case "LabelingJobsClient.NewListPager": + resp, err = l.dispatchNewListPager(req) + case "LabelingJobsClient.Pause": + resp, err = l.dispatchPause(req) + case "LabelingJobsClient.BeginResume": + resp, err = l.dispatchBeginResume(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if l.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := l.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.LabelingJob](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + l.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + l.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + l.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if l.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchBeginExportLabels(req *http.Request) (*http.Response, error) { + if l.srv.BeginExportLabels == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginExportLabels not implemented")} + } + beginExportLabels := l.beginExportLabels.get(req) + if beginExportLabels == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/exportLabels` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + raw, err := readRequestBody(req) + if err != nil { + return nil, err + } + body, err := unmarshalExportSummaryClassification(raw) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginExportLabels(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginExportLabels = &respr + l.beginExportLabels.add(req, beginExportLabels) + } + + resp, err := server.PollerResponderNext(beginExportLabels, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + l.beginExportLabels.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginExportLabels) { + l.beginExportLabels.remove(req) + } + + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if l.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LabelingJob, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if l.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := l.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + var options *armmachinelearning.LabelingJobsClientListOptions + if skipParam != nil || topParam != nil { + options = &armmachinelearning.LabelingJobsClientListOptions{ + Skip: skipParam, + Top: topParam, + } + } + resp := l.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + l.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.LabelingJobsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + l.newListPager.remove(req) + } + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchPause(req *http.Request) (*http.Response, error) { + if l.srv.Pause == nil { + return nil, &nonRetriableError{errors.New("fake for method Pause not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/pause` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Pause(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LabelingJobProperties, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LabelingJobsServerTransport) dispatchBeginResume(req *http.Request) (*http.Response, error) { + if l.srv.BeginResume == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginResume not implemented")} + } + beginResume := l.beginResume.get(req) + if beginResume == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/labelingJobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resume` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + idParam, err := url.PathUnescape(matches[regex.SubexpIndex("id")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginResume(req.Context(), resourceGroupNameParam, workspaceNameParam, idParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginResume = &respr + l.beginResume.add(req, beginResume) + } + + resp, err := server.PollerResponderNext(beginResume, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + l.beginResume.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginResume) { + l.beginResume.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworkprovisions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworkprovisions_server.go new file mode 100644 index 000000000000..a02d477c7141 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworkprovisions_server.go @@ -0,0 +1,126 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "reflect" + "regexp" +) + +// ManagedNetworkProvisionsServer is a fake server for instances of the armmachinelearning.ManagedNetworkProvisionsClient type. +type ManagedNetworkProvisionsServer struct { + // BeginProvisionManagedNetwork is the fake for method ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginProvisionManagedNetwork func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions) (resp azfake.PollerResponder[armmachinelearning.ManagedNetworkProvisionsClientProvisionManagedNetworkResponse], errResp azfake.ErrorResponder) +} + +// NewManagedNetworkProvisionsServerTransport creates a new instance of ManagedNetworkProvisionsServerTransport with the provided implementation. +// The returned ManagedNetworkProvisionsServerTransport instance is connected to an instance of armmachinelearning.ManagedNetworkProvisionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewManagedNetworkProvisionsServerTransport(srv *ManagedNetworkProvisionsServer) *ManagedNetworkProvisionsServerTransport { + return &ManagedNetworkProvisionsServerTransport{ + srv: srv, + beginProvisionManagedNetwork: newTracker[azfake.PollerResponder[armmachinelearning.ManagedNetworkProvisionsClientProvisionManagedNetworkResponse]](), + } +} + +// ManagedNetworkProvisionsServerTransport connects instances of armmachinelearning.ManagedNetworkProvisionsClient to instances of ManagedNetworkProvisionsServer. +// Don't use this type directly, use NewManagedNetworkProvisionsServerTransport instead. +type ManagedNetworkProvisionsServerTransport struct { + srv *ManagedNetworkProvisionsServer + beginProvisionManagedNetwork *tracker[azfake.PollerResponder[armmachinelearning.ManagedNetworkProvisionsClientProvisionManagedNetworkResponse]] +} + +// Do implements the policy.Transporter interface for ManagedNetworkProvisionsServerTransport. +func (m *ManagedNetworkProvisionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork": + resp, err = m.dispatchBeginProvisionManagedNetwork(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *ManagedNetworkProvisionsServerTransport) dispatchBeginProvisionManagedNetwork(req *http.Request) (*http.Response, error) { + if m.srv.BeginProvisionManagedNetwork == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginProvisionManagedNetwork not implemented")} + } + beginProvisionManagedNetwork := m.beginProvisionManagedNetwork.get(req) + if beginProvisionManagedNetwork == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/provisionManagedNetwork` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ManagedNetworkProvisionOptions](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + var options *armmachinelearning.ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions + if !reflect.ValueOf(body).IsZero() { + options = &armmachinelearning.ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions{ + Body: &body, + } + } + respr, errRespr := m.srv.BeginProvisionManagedNetwork(req.Context(), resourceGroupNameParam, workspaceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginProvisionManagedNetwork = &respr + m.beginProvisionManagedNetwork.add(req, beginProvisionManagedNetwork) + } + + resp, err := server.PollerResponderNext(beginProvisionManagedNetwork, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginProvisionManagedNetwork.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginProvisionManagedNetwork) { + m.beginProvisionManagedNetwork.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworksettingsrule_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworksettingsrule_server.go new file mode 100644 index 000000000000..646b9cc70e63 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworksettingsrule_server.go @@ -0,0 +1,272 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// ManagedNetworkSettingsRuleServer is a fake server for instances of the armmachinelearning.ManagedNetworkSettingsRuleClient type. +type ManagedNetworkSettingsRuleServer struct { + // BeginCreateOrUpdate is the fake for method ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, body armmachinelearning.OutboundRuleBasicResource, options *armmachinelearning.ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ManagedNetworkSettingsRuleClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *armmachinelearning.ManagedNetworkSettingsRuleClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ManagedNetworkSettingsRuleClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *armmachinelearning.ManagedNetworkSettingsRuleClientGetOptions) (resp azfake.Responder[armmachinelearning.ManagedNetworkSettingsRuleClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ManagedNetworkSettingsRuleClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.ManagedNetworkSettingsRuleClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientListResponse]) +} + +// NewManagedNetworkSettingsRuleServerTransport creates a new instance of ManagedNetworkSettingsRuleServerTransport with the provided implementation. +// The returned ManagedNetworkSettingsRuleServerTransport instance is connected to an instance of armmachinelearning.ManagedNetworkSettingsRuleClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewManagedNetworkSettingsRuleServerTransport(srv *ManagedNetworkSettingsRuleServer) *ManagedNetworkSettingsRuleServerTransport { + return &ManagedNetworkSettingsRuleServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientListResponse]](), + } +} + +// ManagedNetworkSettingsRuleServerTransport connects instances of armmachinelearning.ManagedNetworkSettingsRuleClient to instances of ManagedNetworkSettingsRuleServer. +// Don't use this type directly, use NewManagedNetworkSettingsRuleServerTransport instead. +type ManagedNetworkSettingsRuleServerTransport struct { + srv *ManagedNetworkSettingsRuleServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ManagedNetworkSettingsRuleClientListResponse]] +} + +// Do implements the policy.Transporter interface for ManagedNetworkSettingsRuleServerTransport. +func (m *ManagedNetworkSettingsRuleServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate": + resp, err = m.dispatchBeginCreateOrUpdate(req) + case "ManagedNetworkSettingsRuleClient.BeginDelete": + resp, err = m.dispatchBeginDelete(req) + case "ManagedNetworkSettingsRuleClient.Get": + resp, err = m.dispatchGet(req) + case "ManagedNetworkSettingsRuleClient.NewListPager": + resp, err = m.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *ManagedNetworkSettingsRuleServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if m.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := m.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/outboundRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.OutboundRuleBasicResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + ruleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("ruleName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, ruleNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + m.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + m.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (m *ManagedNetworkSettingsRuleServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if m.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := m.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/outboundRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + ruleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("ruleName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, ruleNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + m.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + m.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + m.beginDelete.remove(req) + } + + return resp, nil +} + +func (m *ManagedNetworkSettingsRuleServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/outboundRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + ruleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("ruleName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, ruleNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OutboundRuleBasicResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ManagedNetworkSettingsRuleServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := m.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/outboundRules` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nil) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ManagedNetworkSettingsRuleClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelcontainers_server.go new file mode 100644 index 000000000000..2402319cbb93 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelcontainers_server.go @@ -0,0 +1,280 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// ModelContainersServer is a fake server for instances of the armmachinelearning.ModelContainersClient type. +type ModelContainersServer struct { + // CreateOrUpdate is the fake for method ModelContainersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.ModelContainer, options *armmachinelearning.ModelContainersClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.ModelContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method ModelContainersClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ModelContainersClientDeleteOptions) (resp azfake.Responder[armmachinelearning.ModelContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ModelContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ModelContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.ModelContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ModelContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.ModelContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ModelContainersClientListResponse]) +} + +// NewModelContainersServerTransport creates a new instance of ModelContainersServerTransport with the provided implementation. +// The returned ModelContainersServerTransport instance is connected to an instance of armmachinelearning.ModelContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewModelContainersServerTransport(srv *ModelContainersServer) *ModelContainersServerTransport { + return &ModelContainersServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ModelContainersClientListResponse]](), + } +} + +// ModelContainersServerTransport connects instances of armmachinelearning.ModelContainersClient to instances of ModelContainersServer. +// Don't use this type directly, use NewModelContainersServerTransport instead. +type ModelContainersServerTransport struct { + srv *ModelContainersServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ModelContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for ModelContainersServerTransport. +func (m *ModelContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ModelContainersClient.CreateOrUpdate": + resp, err = m.dispatchCreateOrUpdate(req) + case "ModelContainersClient.Delete": + resp, err = m.dispatchDelete(req) + case "ModelContainersClient.Get": + resp, err = m.dispatchGet(req) + case "ModelContainersClient.NewListPager": + resp, err = m.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *ModelContainersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if m.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ModelContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ModelContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ModelContainersServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if m.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ModelContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ModelContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ModelContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := m.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.ModelContainersClientListOptions + if skipParam != nil || countParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.ModelContainersClientListOptions{ + Skip: skipParam, + Count: countParam, + ListViewType: listViewTypeParam, + } + } + resp := m.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ModelContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go new file mode 100644 index 000000000000..0efc8db1de5f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go @@ -0,0 +1,481 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// ModelVersionsServer is a fake server for instances of the armmachinelearning.ModelVersionsClient type. +type ModelVersionsServer struct { + // CreateOrUpdate is the fake for method ModelVersionsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.ModelVersion, options *armmachinelearning.ModelVersionsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.ModelVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method ModelVersionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.ModelVersionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.ModelVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ModelVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *armmachinelearning.ModelVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.ModelVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ModelVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ModelVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ModelVersionsClientListResponse]) + + // BeginPackage is the fake for method ModelVersionsClient.BeginPackage + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginPackage func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.PackageRequest, options *armmachinelearning.ModelVersionsClientBeginPackageOptions) (resp azfake.PollerResponder[armmachinelearning.ModelVersionsClientPackageResponse], errResp azfake.ErrorResponder) + + // BeginPublish is the fake for method ModelVersionsClient.BeginPublish + // HTTP status codes to indicate success: http.StatusAccepted + BeginPublish func(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body armmachinelearning.DestinationAsset, options *armmachinelearning.ModelVersionsClientBeginPublishOptions) (resp azfake.PollerResponder[armmachinelearning.ModelVersionsClientPublishResponse], errResp azfake.ErrorResponder) +} + +// NewModelVersionsServerTransport creates a new instance of ModelVersionsServerTransport with the provided implementation. +// The returned ModelVersionsServerTransport instance is connected to an instance of armmachinelearning.ModelVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewModelVersionsServerTransport(srv *ModelVersionsServer) *ModelVersionsServerTransport { + return &ModelVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ModelVersionsClientListResponse]](), + beginPackage: newTracker[azfake.PollerResponder[armmachinelearning.ModelVersionsClientPackageResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.ModelVersionsClientPublishResponse]](), + } +} + +// ModelVersionsServerTransport connects instances of armmachinelearning.ModelVersionsClient to instances of ModelVersionsServer. +// Don't use this type directly, use NewModelVersionsServerTransport instead. +type ModelVersionsServerTransport struct { + srv *ModelVersionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ModelVersionsClientListResponse]] + beginPackage *tracker[azfake.PollerResponder[armmachinelearning.ModelVersionsClientPackageResponse]] + beginPublish *tracker[azfake.PollerResponder[armmachinelearning.ModelVersionsClientPublishResponse]] +} + +// Do implements the policy.Transporter interface for ModelVersionsServerTransport. +func (m *ModelVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ModelVersionsClient.CreateOrUpdate": + resp, err = m.dispatchCreateOrUpdate(req) + case "ModelVersionsClient.Delete": + resp, err = m.dispatchDelete(req) + case "ModelVersionsClient.Get": + resp, err = m.dispatchGet(req) + case "ModelVersionsClient.NewListPager": + resp, err = m.dispatchNewListPager(req) + case "ModelVersionsClient.BeginPackage": + resp, err = m.dispatchBeginPackage(req) + case "ModelVersionsClient.BeginPublish": + resp, err = m.dispatchBeginPublish(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *ModelVersionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if m.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ModelVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ModelVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ModelVersionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if m.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ModelVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ModelVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ModelVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := m.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + versionUnescaped, err := url.QueryUnescape(qp.Get("version")) + if err != nil { + return nil, err + } + versionParam := getOptional(versionUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + offsetUnescaped, err := url.QueryUnescape(qp.Get("offset")) + if err != nil { + return nil, err + } + offsetParam, err := parseOptional(offsetUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + feedUnescaped, err := url.QueryUnescape(qp.Get("feed")) + if err != nil { + return nil, err + } + feedParam := getOptional(feedUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.ModelVersionsClientListOptions + if skipParam != nil || orderByParam != nil || topParam != nil || versionParam != nil || descriptionParam != nil || offsetParam != nil || tagsParam != nil || propertiesParam != nil || feedParam != nil || listViewTypeParam != nil || stageParam != nil { + options = &armmachinelearning.ModelVersionsClientListOptions{ + Skip: skipParam, + OrderBy: orderByParam, + Top: topParam, + Version: versionParam, + Description: descriptionParam, + Offset: offsetParam, + Tags: tagsParam, + Properties: propertiesParam, + Feed: feedParam, + ListViewType: listViewTypeParam, + Stage: stageParam, + } + } + resp := m.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ModelVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) + } + return resp, nil +} + +func (m *ModelVersionsServerTransport) dispatchBeginPackage(req *http.Request) (*http.Response, error) { + if m.srv.BeginPackage == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPackage not implemented")} + } + beginPackage := m.beginPackage.get(req) + if beginPackage == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/package` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PackageRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginPackage(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPackage = &respr + m.beginPackage.add(req, beginPackage) + } + + resp, err := server.PollerResponderNext(beginPackage, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginPackage.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPackage) { + m.beginPackage.remove(req) + } + + return resp, nil +} + +func (m *ModelVersionsServerTransport) dispatchBeginPublish(req *http.Request) (*http.Response, error) { + if m.srv.BeginPublish == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPublish not implemented")} + } + beginPublish := m.beginPublish.get(req) + if beginPublish == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/publish` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DestinationAsset](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginPublish(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPublish = &respr + m.beginPublish.add(req, beginPublish) + } + + resp, err := server.PollerResponderNext(beginPublish, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + m.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPublish) { + m.beginPublish.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlinedeployments_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlinedeployments_server.go new file mode 100644 index 000000000000..167527d7a6c8 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlinedeployments_server.go @@ -0,0 +1,521 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// OnlineDeploymentsServer is a fake server for instances of the armmachinelearning.OnlineDeploymentsClient type. +type OnlineDeploymentsServer struct { + // BeginCreateOrUpdate is the fake for method OnlineDeploymentsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body armmachinelearning.OnlineDeployment, options *armmachinelearning.OnlineDeploymentsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method OnlineDeploymentsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *armmachinelearning.OnlineDeploymentsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method OnlineDeploymentsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *armmachinelearning.OnlineDeploymentsClientGetOptions) (resp azfake.Responder[armmachinelearning.OnlineDeploymentsClientGetResponse], errResp azfake.ErrorResponder) + + // GetLogs is the fake for method OnlineDeploymentsClient.GetLogs + // HTTP status codes to indicate success: http.StatusOK + GetLogs func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body armmachinelearning.DeploymentLogsRequest, options *armmachinelearning.OnlineDeploymentsClientGetLogsOptions) (resp azfake.Responder[armmachinelearning.OnlineDeploymentsClientGetLogsResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method OnlineDeploymentsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.OnlineDeploymentsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.OnlineDeploymentsClientListResponse]) + + // NewListSKUsPager is the fake for method OnlineDeploymentsClient.NewListSKUsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSKUsPager func(resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *armmachinelearning.OnlineDeploymentsClientListSKUsOptions) (resp azfake.PagerResponder[armmachinelearning.OnlineDeploymentsClientListSKUsResponse]) + + // BeginUpdate is the fake for method OnlineDeploymentsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body armmachinelearning.PartialMinimalTrackedResourceWithSKU, options *armmachinelearning.OnlineDeploymentsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewOnlineDeploymentsServerTransport creates a new instance of OnlineDeploymentsServerTransport with the provided implementation. +// The returned OnlineDeploymentsServerTransport instance is connected to an instance of armmachinelearning.OnlineDeploymentsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewOnlineDeploymentsServerTransport(srv *OnlineDeploymentsServer) *OnlineDeploymentsServerTransport { + return &OnlineDeploymentsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.OnlineDeploymentsClientListResponse]](), + newListSKUsPager: newTracker[azfake.PagerResponder[armmachinelearning.OnlineDeploymentsClientListSKUsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientUpdateResponse]](), + } +} + +// OnlineDeploymentsServerTransport connects instances of armmachinelearning.OnlineDeploymentsClient to instances of OnlineDeploymentsServer. +// Don't use this type directly, use NewOnlineDeploymentsServerTransport instead. +type OnlineDeploymentsServerTransport struct { + srv *OnlineDeploymentsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.OnlineDeploymentsClientListResponse]] + newListSKUsPager *tracker[azfake.PagerResponder[armmachinelearning.OnlineDeploymentsClientListSKUsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.OnlineDeploymentsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for OnlineDeploymentsServerTransport. +func (o *OnlineDeploymentsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "OnlineDeploymentsClient.BeginCreateOrUpdate": + resp, err = o.dispatchBeginCreateOrUpdate(req) + case "OnlineDeploymentsClient.BeginDelete": + resp, err = o.dispatchBeginDelete(req) + case "OnlineDeploymentsClient.Get": + resp, err = o.dispatchGet(req) + case "OnlineDeploymentsClient.GetLogs": + resp, err = o.dispatchGetLogs(req) + case "OnlineDeploymentsClient.NewListPager": + resp, err = o.dispatchNewListPager(req) + case "OnlineDeploymentsClient.NewListSKUsPager": + resp, err = o.dispatchNewListSKUsPager(req) + case "OnlineDeploymentsClient.BeginUpdate": + resp, err = o.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if o.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := o.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.OnlineDeployment](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + o.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + o.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + o.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if o.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := o.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + o.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + o.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + o.beginDelete.remove(req) + } + + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if o.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OnlineDeployment, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchGetLogs(req *http.Request) (*http.Response, error) { + if o.srv.GetLogs == nil { + return nil, &nonRetriableError{errors.New("fake for method GetLogs not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getLogs` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DeploymentLogsRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.GetLogs(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DeploymentLogs, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := o.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.OnlineDeploymentsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil { + options = &armmachinelearning.OnlineDeploymentsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + } + } + resp := o.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, endpointNameParam, options) + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.OnlineDeploymentsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchNewListSKUsPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListSKUsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSKUsPager not implemented")} + } + newListSKUsPager := o.newListSKUsPager.get(req) + if newListSKUsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.OnlineDeploymentsClientListSKUsOptions + if countParam != nil || skipParam != nil { + options = &armmachinelearning.OnlineDeploymentsClientListSKUsOptions{ + Count: countParam, + Skip: skipParam, + } + } + resp := o.srv.NewListSKUsPager(resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, options) + newListSKUsPager = &resp + o.newListSKUsPager.add(req, newListSKUsPager) + server.PagerResponderInjectNextLinks(newListSKUsPager, req, func(page *armmachinelearning.OnlineDeploymentsClientListSKUsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSKUsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListSKUsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSKUsPager) { + o.newListSKUsPager.remove(req) + } + return resp, nil +} + +func (o *OnlineDeploymentsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if o.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := o.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithSKU](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + deploymentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deploymentName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, deploymentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + o.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + o.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + o.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go new file mode 100644 index 000000000000..25e207f398cb --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go @@ -0,0 +1,536 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// OnlineEndpointsServer is a fake server for instances of the armmachinelearning.OnlineEndpointsClient type. +type OnlineEndpointsServer struct { + // BeginCreateOrUpdate is the fake for method OnlineEndpointsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body armmachinelearning.OnlineEndpoint, options *armmachinelearning.OnlineEndpointsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method OnlineEndpointsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.OnlineEndpointsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method OnlineEndpointsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.OnlineEndpointsClientGetOptions) (resp azfake.Responder[armmachinelearning.OnlineEndpointsClientGetResponse], errResp azfake.ErrorResponder) + + // GetToken is the fake for method OnlineEndpointsClient.GetToken + // HTTP status codes to indicate success: http.StatusOK + GetToken func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.OnlineEndpointsClientGetTokenOptions) (resp azfake.Responder[armmachinelearning.OnlineEndpointsClientGetTokenResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method OnlineEndpointsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.OnlineEndpointsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.OnlineEndpointsClientListResponse]) + + // ListKeys is the fake for method OnlineEndpointsClient.ListKeys + // HTTP status codes to indicate success: http.StatusOK + ListKeys func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *armmachinelearning.OnlineEndpointsClientListKeysOptions) (resp azfake.Responder[armmachinelearning.OnlineEndpointsClientListKeysResponse], errResp azfake.ErrorResponder) + + // BeginRegenerateKeys is the fake for method OnlineEndpointsClient.BeginRegenerateKeys + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginRegenerateKeys func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body armmachinelearning.RegenerateEndpointKeysRequest, options *armmachinelearning.OnlineEndpointsClientBeginRegenerateKeysOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientRegenerateKeysResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method OnlineEndpointsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body armmachinelearning.PartialMinimalTrackedResourceWithIdentity, options *armmachinelearning.OnlineEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewOnlineEndpointsServerTransport creates a new instance of OnlineEndpointsServerTransport with the provided implementation. +// The returned OnlineEndpointsServerTransport instance is connected to an instance of armmachinelearning.OnlineEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewOnlineEndpointsServerTransport(srv *OnlineEndpointsServer) *OnlineEndpointsServerTransport { + return &OnlineEndpointsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.OnlineEndpointsClientListResponse]](), + beginRegenerateKeys: newTracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientRegenerateKeysResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientUpdateResponse]](), + } +} + +// OnlineEndpointsServerTransport connects instances of armmachinelearning.OnlineEndpointsClient to instances of OnlineEndpointsServer. +// Don't use this type directly, use NewOnlineEndpointsServerTransport instead. +type OnlineEndpointsServerTransport struct { + srv *OnlineEndpointsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.OnlineEndpointsClientListResponse]] + beginRegenerateKeys *tracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientRegenerateKeysResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.OnlineEndpointsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for OnlineEndpointsServerTransport. +func (o *OnlineEndpointsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "OnlineEndpointsClient.BeginCreateOrUpdate": + resp, err = o.dispatchBeginCreateOrUpdate(req) + case "OnlineEndpointsClient.BeginDelete": + resp, err = o.dispatchBeginDelete(req) + case "OnlineEndpointsClient.Get": + resp, err = o.dispatchGet(req) + case "OnlineEndpointsClient.GetToken": + resp, err = o.dispatchGetToken(req) + case "OnlineEndpointsClient.NewListPager": + resp, err = o.dispatchNewListPager(req) + case "OnlineEndpointsClient.ListKeys": + resp, err = o.dispatchListKeys(req) + case "OnlineEndpointsClient.BeginRegenerateKeys": + resp, err = o.dispatchBeginRegenerateKeys(req) + case "OnlineEndpointsClient.BeginUpdate": + resp, err = o.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if o.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := o.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.OnlineEndpoint](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + o.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + o.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + o.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if o.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := o.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + o.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + o.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + o.beginDelete.remove(req) + } + + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if o.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OnlineEndpoint, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchGetToken(req *http.Request) (*http.Response, error) { + if o.srv.GetToken == nil { + return nil, &nonRetriableError{errors.New("fake for method GetToken not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/token` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.GetToken(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EndpointAuthToken, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := o.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameUnescaped, err := url.QueryUnescape(qp.Get("name")) + if err != nil { + return nil, err + } + nameParam := getOptional(nameUnescaped) + countUnescaped, err := url.QueryUnescape(qp.Get("count")) + if err != nil { + return nil, err + } + countParam, err := parseOptional(countUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + computeTypeUnescaped, err := url.QueryUnescape(qp.Get("computeType")) + if err != nil { + return nil, err + } + computeTypeParam := getOptional(armmachinelearning.EndpointComputeType(computeTypeUnescaped)) + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(armmachinelearning.OrderString(orderByUnescaped)) + var options *armmachinelearning.OnlineEndpointsClientListOptions + if nameParam != nil || countParam != nil || computeTypeParam != nil || skipParam != nil || tagsParam != nil || propertiesParam != nil || orderByParam != nil { + options = &armmachinelearning.OnlineEndpointsClientListOptions{ + Name: nameParam, + Count: countParam, + ComputeType: computeTypeParam, + Skip: skipParam, + Tags: tagsParam, + Properties: propertiesParam, + OrderBy: orderByParam, + } + } + resp := o.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.OnlineEndpointsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchListKeys(req *http.Request) (*http.Response, error) { + if o.srv.ListKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.ListKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EndpointAuthKeys, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchBeginRegenerateKeys(req *http.Request) (*http.Response, error) { + if o.srv.BeginRegenerateKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRegenerateKeys not implemented")} + } + beginRegenerateKeys := o.beginRegenerateKeys.get(req) + if beginRegenerateKeys == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regenerateKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.RegenerateEndpointKeysRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginRegenerateKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRegenerateKeys = &respr + o.beginRegenerateKeys.add(req, beginRegenerateKeys) + } + + resp, err := server.PollerResponderNext(beginRegenerateKeys, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + o.beginRegenerateKeys.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRegenerateKeys) { + o.beginRegenerateKeys.remove(req) + } + + return resp, nil +} + +func (o *OnlineEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if o.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := o.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/onlineEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithIdentity](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + endpointNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("endpointName")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, endpointNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + o.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + o.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + o.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go new file mode 100644 index 000000000000..bc514fbf6300 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go @@ -0,0 +1,92 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" +) + +// OperationsServer is a fake server for instances of the armmachinelearning.OperationsClient type. +type OperationsServer struct { + // NewListPager is the fake for method OperationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(options *armmachinelearning.OperationsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.OperationsClientListResponse]) +} + +// NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. +// The returned OperationsServerTransport instance is connected to an instance of armmachinelearning.OperationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { + return &OperationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.OperationsClientListResponse]](), + } +} + +// OperationsServerTransport connects instances of armmachinelearning.OperationsClient to instances of OperationsServer. +// Don't use this type directly, use NewOperationsServerTransport instead. +type OperationsServerTransport struct { + srv *OperationsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.OperationsClientListResponse]] +} + +// Do implements the policy.Transporter interface for OperationsServerTransport. +func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "OperationsClient.NewListPager": + resp, err = o.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := o.newListPager.get(req) + if newListPager == nil { + resp := o.srv.NewListPager(nil) + newListPager = &resp + o.newListPager.add(req, newListPager) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/polymorphic_helpers.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/polymorphic_helpers.go new file mode 100644 index 000000000000..b35fe72b3983 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/polymorphic_helpers.go @@ -0,0 +1,39 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" +) + +func unmarshalExportSummaryClassification(rawMsg json.RawMessage) (armmachinelearning.ExportSummaryClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b armmachinelearning.ExportSummaryClassification + switch m["format"] { + case string(armmachinelearning.ExportFormatTypeCSV): + b = &armmachinelearning.CSVExportSummary{} + case string(armmachinelearning.ExportFormatTypeCoco): + b = &armmachinelearning.CocoExportSummary{} + case string(armmachinelearning.ExportFormatTypeDataset): + b = &armmachinelearning.DatasetExportSummary{} + default: + b = &armmachinelearning.ExportSummary{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go new file mode 100644 index 000000000000..e7c079187f13 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go @@ -0,0 +1,242 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// PrivateEndpointConnectionsServer is a fake server for instances of the armmachinelearning.PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsServer struct { + // CreateOrUpdate is the fake for method PrivateEndpointConnectionsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK + CreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, body armmachinelearning.PrivateEndpointConnection, options *armmachinelearning.PrivateEndpointConnectionsClientCreateOrUpdateOptions) (resp azfake.Responder[armmachinelearning.PrivateEndpointConnectionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method PrivateEndpointConnectionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *armmachinelearning.PrivateEndpointConnectionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method PrivateEndpointConnectionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *armmachinelearning.PrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armmachinelearning.PrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method PrivateEndpointConnectionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.PrivateEndpointConnectionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.PrivateEndpointConnectionsClientListResponse]) +} + +// NewPrivateEndpointConnectionsServerTransport creates a new instance of PrivateEndpointConnectionsServerTransport with the provided implementation. +// The returned PrivateEndpointConnectionsServerTransport instance is connected to an instance of armmachinelearning.PrivateEndpointConnectionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateEndpointConnectionsServerTransport(srv *PrivateEndpointConnectionsServer) *PrivateEndpointConnectionsServerTransport { + return &PrivateEndpointConnectionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.PrivateEndpointConnectionsClientListResponse]](), + } +} + +// PrivateEndpointConnectionsServerTransport connects instances of armmachinelearning.PrivateEndpointConnectionsClient to instances of PrivateEndpointConnectionsServer. +// Don't use this type directly, use NewPrivateEndpointConnectionsServerTransport instead. +type PrivateEndpointConnectionsServerTransport struct { + srv *PrivateEndpointConnectionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.PrivateEndpointConnectionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for PrivateEndpointConnectionsServerTransport. +func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "PrivateEndpointConnectionsClient.CreateOrUpdate": + resp, err = p.dispatchCreateOrUpdate(req) + case "PrivateEndpointConnectionsClient.Delete": + resp, err = p.dispatchDelete(req) + case "PrivateEndpointConnectionsClient.Get": + resp, err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.NewListPager": + resp, err = p.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if p.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PrivateEndpointConnection](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, privateEndpointConnectionNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if p.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, privateEndpointConnectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, privateEndpointConnectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := p.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + resp := p.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nil) + newListPager = &resp + p.newListPager.add(req, newListPager) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + p.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go new file mode 100644 index 000000000000..292b0f638318 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go @@ -0,0 +1,108 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// PrivateLinkResourcesServer is a fake server for instances of the armmachinelearning.PrivateLinkResourcesClient type. +type PrivateLinkResourcesServer struct { + // NewListPager is the fake for method PrivateLinkResourcesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.PrivateLinkResourcesClientListOptions) (resp azfake.PagerResponder[armmachinelearning.PrivateLinkResourcesClientListResponse]) +} + +// NewPrivateLinkResourcesServerTransport creates a new instance of PrivateLinkResourcesServerTransport with the provided implementation. +// The returned PrivateLinkResourcesServerTransport instance is connected to an instance of armmachinelearning.PrivateLinkResourcesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPrivateLinkResourcesServerTransport(srv *PrivateLinkResourcesServer) *PrivateLinkResourcesServerTransport { + return &PrivateLinkResourcesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.PrivateLinkResourcesClientListResponse]](), + } +} + +// PrivateLinkResourcesServerTransport connects instances of armmachinelearning.PrivateLinkResourcesClient to instances of PrivateLinkResourcesServer. +// Don't use this type directly, use NewPrivateLinkResourcesServerTransport instead. +type PrivateLinkResourcesServerTransport struct { + srv *PrivateLinkResourcesServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.PrivateLinkResourcesClientListResponse]] +} + +// Do implements the policy.Transporter interface for PrivateLinkResourcesServerTransport. +func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "PrivateLinkResourcesClient.NewListPager": + resp, err = p.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (p *PrivateLinkResourcesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := p.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + resp := p.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nil) + newListPager = &resp + p.newListPager.add(req, newListPager) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + p.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go new file mode 100644 index 000000000000..7542bd484c84 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go @@ -0,0 +1,148 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// QuotasServer is a fake server for instances of the armmachinelearning.QuotasClient type. +type QuotasServer struct { + // NewListPager is the fake for method QuotasClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(location string, options *armmachinelearning.QuotasClientListOptions) (resp azfake.PagerResponder[armmachinelearning.QuotasClientListResponse]) + + // Update is the fake for method QuotasClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, location string, parameters armmachinelearning.QuotaUpdateParameters, options *armmachinelearning.QuotasClientUpdateOptions) (resp azfake.Responder[armmachinelearning.QuotasClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewQuotasServerTransport creates a new instance of QuotasServerTransport with the provided implementation. +// The returned QuotasServerTransport instance is connected to an instance of armmachinelearning.QuotasClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewQuotasServerTransport(srv *QuotasServer) *QuotasServerTransport { + return &QuotasServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.QuotasClientListResponse]](), + } +} + +// QuotasServerTransport connects instances of armmachinelearning.QuotasClient to instances of QuotasServer. +// Don't use this type directly, use NewQuotasServerTransport instead. +type QuotasServerTransport struct { + srv *QuotasServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.QuotasClientListResponse]] +} + +// Do implements the policy.Transporter interface for QuotasServerTransport. +func (q *QuotasServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "QuotasClient.NewListPager": + resp, err = q.dispatchNewListPager(req) + case "QuotasClient.Update": + resp, err = q.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (q *QuotasServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if q.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := q.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/quotas` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + resp := q.srv.NewListPager(locationParam, nil) + newListPager = &resp + q.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.QuotasClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + q.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + q.newListPager.remove(req) + } + return resp, nil +} + +func (q *QuotasServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if q.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateQuotas` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.QuotaUpdateParameters](req) + if err != nil { + return nil, err + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + respr, errRespr := q.srv.Update(req.Context(), locationParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).UpdateWorkspaceQuotasResult, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registries_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registries_server.go new file mode 100644 index 000000000000..85fb9e2b4fc3 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registries_server.go @@ -0,0 +1,396 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistriesServer is a fake server for instances of the armmachinelearning.RegistriesClient type. +type RegistriesServer struct { + // BeginCreateOrUpdate is the fake for method RegistriesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, body armmachinelearning.Registry, options *armmachinelearning.RegistriesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistriesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistriesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, options *armmachinelearning.RegistriesClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistriesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistriesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, options *armmachinelearning.RegistriesClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistriesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistriesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armmachinelearning.RegistriesClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistriesClientListResponse]) + + // NewListBySubscriptionPager is the fake for method RegistriesClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armmachinelearning.RegistriesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armmachinelearning.RegistriesClientListBySubscriptionResponse]) + + // BeginRemoveRegions is the fake for method RegistriesClient.BeginRemoveRegions + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginRemoveRegions func(ctx context.Context, resourceGroupName string, registryName string, body armmachinelearning.Registry, options *armmachinelearning.RegistriesClientBeginRemoveRegionsOptions) (resp azfake.PollerResponder[armmachinelearning.RegistriesClientRemoveRegionsResponse], errResp azfake.ErrorResponder) + + // Update is the fake for method RegistriesClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, registryName string, body armmachinelearning.PartialRegistryPartialTrackedResource, options *armmachinelearning.RegistriesClientUpdateOptions) (resp azfake.Responder[armmachinelearning.RegistriesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewRegistriesServerTransport creates a new instance of RegistriesServerTransport with the provided implementation. +// The returned RegistriesServerTransport instance is connected to an instance of armmachinelearning.RegistriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistriesServerTransport(srv *RegistriesServer) *RegistriesServerTransport { + return &RegistriesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistriesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistriesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistriesClientListResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistriesClientListBySubscriptionResponse]](), + beginRemoveRegions: newTracker[azfake.PollerResponder[armmachinelearning.RegistriesClientRemoveRegionsResponse]](), + } +} + +// RegistriesServerTransport connects instances of armmachinelearning.RegistriesClient to instances of RegistriesServer. +// Don't use this type directly, use NewRegistriesServerTransport instead. +type RegistriesServerTransport struct { + srv *RegistriesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistriesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistriesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistriesClientListResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmachinelearning.RegistriesClientListBySubscriptionResponse]] + beginRemoveRegions *tracker[azfake.PollerResponder[armmachinelearning.RegistriesClientRemoveRegionsResponse]] +} + +// Do implements the policy.Transporter interface for RegistriesServerTransport. +func (r *RegistriesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistriesClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistriesClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistriesClient.Get": + resp, err = r.dispatchGet(req) + case "RegistriesClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + case "RegistriesClient.NewListBySubscriptionPager": + resp, err = r.dispatchNewListBySubscriptionPager(req) + case "RegistriesClient.BeginRemoveRegions": + resp, err = r.dispatchBeginRemoveRegions(req) + case "RegistriesClient.Update": + resp, err = r.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.Registry](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Registry, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := r.srv.NewListPager(resourceGroupNameParam, nil) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistriesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := r.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := r.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + r.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmachinelearning.RegistriesClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + r.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchBeginRemoveRegions(req *http.Request) (*http.Response, error) { + if r.srv.BeginRemoveRegions == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRemoveRegions not implemented")} + } + beginRemoveRegions := r.beginRemoveRegions.get(req) + if beginRemoveRegions == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/removeRegions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.Registry](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginRemoveRegions(req.Context(), resourceGroupNameParam, registryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRemoveRegions = &respr + r.beginRemoveRegions.add(req, beginRemoveRegions) + } + + resp, err := server.PollerResponderNext(beginRemoveRegions, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginRemoveRegions.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRemoveRegions) { + r.beginRemoveRegions.remove(req) + } + + return resp, nil +} + +func (r *RegistriesServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if r.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialRegistryPartialTrackedResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Update(req.Context(), resourceGroupNameParam, registryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Registry, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodecontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodecontainers_server.go new file mode 100644 index 000000000000..d528807a8b81 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodecontainers_server.go @@ -0,0 +1,284 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistryCodeContainersServer is a fake server for instances of the armmachinelearning.RegistryCodeContainersClient type. +type RegistryCodeContainersServer struct { + // BeginCreateOrUpdate is the fake for method RegistryCodeContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, codeName string, body armmachinelearning.CodeContainer, options *armmachinelearning.RegistryCodeContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryCodeContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryCodeContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *armmachinelearning.RegistryCodeContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryCodeContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryCodeContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *armmachinelearning.RegistryCodeContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryCodeContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryCodeContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armmachinelearning.RegistryCodeContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryCodeContainersClientListResponse]) +} + +// NewRegistryCodeContainersServerTransport creates a new instance of RegistryCodeContainersServerTransport with the provided implementation. +// The returned RegistryCodeContainersServerTransport instance is connected to an instance of armmachinelearning.RegistryCodeContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryCodeContainersServerTransport(srv *RegistryCodeContainersServer) *RegistryCodeContainersServerTransport { + return &RegistryCodeContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryCodeContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryCodeContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryCodeContainersClientListResponse]](), + } +} + +// RegistryCodeContainersServerTransport connects instances of armmachinelearning.RegistryCodeContainersClient to instances of RegistryCodeContainersServer. +// Don't use this type directly, use NewRegistryCodeContainersServerTransport instead. +type RegistryCodeContainersServerTransport struct { + srv *RegistryCodeContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryCodeContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryCodeContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryCodeContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryCodeContainersServerTransport. +func (r *RegistryCodeContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryCodeContainersClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryCodeContainersClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryCodeContainersClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryCodeContainersClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryCodeContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.CodeContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryCodeContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryCodeContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CodeContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryCodeContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.RegistryCodeContainersClientListOptions + if skipParam != nil { + options = &armmachinelearning.RegistryCodeContainersClientListOptions{ + Skip: skipParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryCodeContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodeversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodeversions_server.go new file mode 100644 index 000000000000..3fd53698c972 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycodeversions_server.go @@ -0,0 +1,373 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// RegistryCodeVersionsServer is a fake server for instances of the armmachinelearning.RegistryCodeVersionsClient type. +type RegistryCodeVersionsServer struct { + // CreateOrGetStartPendingUpload is the fake for method RegistryCodeVersionsClient.CreateOrGetStartPendingUpload + // HTTP status codes to indicate success: http.StatusOK + CreateOrGetStartPendingUpload func(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body armmachinelearning.PendingUploadRequestDto, options *armmachinelearning.RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions) (resp azfake.Responder[armmachinelearning.RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method RegistryCodeVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body armmachinelearning.CodeVersion, options *armmachinelearning.RegistryCodeVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryCodeVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryCodeVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *armmachinelearning.RegistryCodeVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryCodeVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryCodeVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *armmachinelearning.RegistryCodeVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryCodeVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryCodeVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, codeName string, options *armmachinelearning.RegistryCodeVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryCodeVersionsClientListResponse]) +} + +// NewRegistryCodeVersionsServerTransport creates a new instance of RegistryCodeVersionsServerTransport with the provided implementation. +// The returned RegistryCodeVersionsServerTransport instance is connected to an instance of armmachinelearning.RegistryCodeVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryCodeVersionsServerTransport(srv *RegistryCodeVersionsServer) *RegistryCodeVersionsServerTransport { + return &RegistryCodeVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryCodeVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryCodeVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryCodeVersionsClientListResponse]](), + } +} + +// RegistryCodeVersionsServerTransport connects instances of armmachinelearning.RegistryCodeVersionsClient to instances of RegistryCodeVersionsServer. +// Don't use this type directly, use NewRegistryCodeVersionsServerTransport instead. +type RegistryCodeVersionsServerTransport struct { + srv *RegistryCodeVersionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryCodeVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryCodeVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryCodeVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryCodeVersionsServerTransport. +func (r *RegistryCodeVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryCodeVersionsClient.CreateOrGetStartPendingUpload": + resp, err = r.dispatchCreateOrGetStartPendingUpload(req) + case "RegistryCodeVersionsClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryCodeVersionsClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryCodeVersionsClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryCodeVersionsClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryCodeVersionsServerTransport) dispatchCreateOrGetStartPendingUpload(req *http.Request) (*http.Response, error) { + if r.srv.CreateOrGetStartPendingUpload == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrGetStartPendingUpload not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startPendingUpload` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PendingUploadRequestDto](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.CreateOrGetStartPendingUpload(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PendingUploadResponseDto, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryCodeVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.CodeVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryCodeVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryCodeVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, codeNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CodeVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryCodeVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/codes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + codeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("codeName")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.RegistryCodeVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil { + options = &armmachinelearning.RegistryCodeVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, codeNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryCodeVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentcontainers_server.go new file mode 100644 index 000000000000..563596cc731f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentcontainers_server.go @@ -0,0 +1,284 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistryComponentContainersServer is a fake server for instances of the armmachinelearning.RegistryComponentContainersClient type. +type RegistryComponentContainersServer struct { + // BeginCreateOrUpdate is the fake for method RegistryComponentContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, componentName string, body armmachinelearning.ComponentContainer, options *armmachinelearning.RegistryComponentContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryComponentContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryComponentContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *armmachinelearning.RegistryComponentContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryComponentContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryComponentContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *armmachinelearning.RegistryComponentContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryComponentContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryComponentContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armmachinelearning.RegistryComponentContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryComponentContainersClientListResponse]) +} + +// NewRegistryComponentContainersServerTransport creates a new instance of RegistryComponentContainersServerTransport with the provided implementation. +// The returned RegistryComponentContainersServerTransport instance is connected to an instance of armmachinelearning.RegistryComponentContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryComponentContainersServerTransport(srv *RegistryComponentContainersServer) *RegistryComponentContainersServerTransport { + return &RegistryComponentContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryComponentContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryComponentContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryComponentContainersClientListResponse]](), + } +} + +// RegistryComponentContainersServerTransport connects instances of armmachinelearning.RegistryComponentContainersClient to instances of RegistryComponentContainersServer. +// Don't use this type directly, use NewRegistryComponentContainersServerTransport instead. +type RegistryComponentContainersServerTransport struct { + srv *RegistryComponentContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryComponentContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryComponentContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryComponentContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryComponentContainersServerTransport. +func (r *RegistryComponentContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryComponentContainersClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryComponentContainersClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryComponentContainersClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryComponentContainersClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryComponentContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ComponentContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, componentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryComponentContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, componentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryComponentContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, componentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComponentContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryComponentContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.RegistryComponentContainersClientListOptions + if skipParam != nil { + options = &armmachinelearning.RegistryComponentContainersClientListOptions{ + Skip: skipParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryComponentContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentversions_server.go new file mode 100644 index 000000000000..1abe376eadd1 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentversions_server.go @@ -0,0 +1,328 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// RegistryComponentVersionsServer is a fake server for instances of the armmachinelearning.RegistryComponentVersionsClient type. +type RegistryComponentVersionsServer struct { + // BeginCreateOrUpdate is the fake for method RegistryComponentVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, body armmachinelearning.ComponentVersion, options *armmachinelearning.RegistryComponentVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryComponentVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryComponentVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *armmachinelearning.RegistryComponentVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryComponentVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryComponentVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *armmachinelearning.RegistryComponentVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryComponentVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryComponentVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, componentName string, options *armmachinelearning.RegistryComponentVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryComponentVersionsClientListResponse]) +} + +// NewRegistryComponentVersionsServerTransport creates a new instance of RegistryComponentVersionsServerTransport with the provided implementation. +// The returned RegistryComponentVersionsServerTransport instance is connected to an instance of armmachinelearning.RegistryComponentVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryComponentVersionsServerTransport(srv *RegistryComponentVersionsServer) *RegistryComponentVersionsServerTransport { + return &RegistryComponentVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryComponentVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryComponentVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryComponentVersionsClientListResponse]](), + } +} + +// RegistryComponentVersionsServerTransport connects instances of armmachinelearning.RegistryComponentVersionsClient to instances of RegistryComponentVersionsServer. +// Don't use this type directly, use NewRegistryComponentVersionsServerTransport instead. +type RegistryComponentVersionsServerTransport struct { + srv *RegistryComponentVersionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryComponentVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryComponentVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryComponentVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryComponentVersionsServerTransport. +func (r *RegistryComponentVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryComponentVersionsClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryComponentVersionsClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryComponentVersionsClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryComponentVersionsClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryComponentVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ComponentVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, componentNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryComponentVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, componentNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryComponentVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, componentNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ComponentVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryComponentVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/components/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.RegistryComponentVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || stageParam != nil { + options = &armmachinelearning.RegistryComponentVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + Stage: stageParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, componentNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryComponentVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatacontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatacontainers_server.go new file mode 100644 index 000000000000..8f6cc35d6004 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatacontainers_server.go @@ -0,0 +1,290 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistryDataContainersServer is a fake server for instances of the armmachinelearning.RegistryDataContainersClient type. +type RegistryDataContainersServer struct { + // BeginCreateOrUpdate is the fake for method RegistryDataContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, name string, body armmachinelearning.DataContainer, options *armmachinelearning.RegistryDataContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryDataContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryDataContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, name string, options *armmachinelearning.RegistryDataContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryDataContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryDataContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, name string, options *armmachinelearning.RegistryDataContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryDataContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryDataContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armmachinelearning.RegistryDataContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryDataContainersClientListResponse]) +} + +// NewRegistryDataContainersServerTransport creates a new instance of RegistryDataContainersServerTransport with the provided implementation. +// The returned RegistryDataContainersServerTransport instance is connected to an instance of armmachinelearning.RegistryDataContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryDataContainersServerTransport(srv *RegistryDataContainersServer) *RegistryDataContainersServerTransport { + return &RegistryDataContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryDataContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryDataContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryDataContainersClientListResponse]](), + } +} + +// RegistryDataContainersServerTransport connects instances of armmachinelearning.RegistryDataContainersClient to instances of RegistryDataContainersServer. +// Don't use this type directly, use NewRegistryDataContainersServerTransport instead. +type RegistryDataContainersServerTransport struct { + srv *RegistryDataContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryDataContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryDataContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryDataContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryDataContainersServerTransport. +func (r *RegistryDataContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryDataContainersClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryDataContainersClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryDataContainersClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryDataContainersClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryDataContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DataContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryDataContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryDataContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryDataContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.RegistryDataContainersClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.RegistryDataContainersClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryDataContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatareferences_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatareferences_server.go new file mode 100644 index 000000000000..dc3992e54c75 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydatareferences_server.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistryDataReferencesServer is a fake server for instances of the armmachinelearning.RegistryDataReferencesClient type. +type RegistryDataReferencesServer struct { + // GetBlobReferenceSAS is the fake for method RegistryDataReferencesClient.GetBlobReferenceSAS + // HTTP status codes to indicate success: http.StatusOK + GetBlobReferenceSAS func(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body armmachinelearning.GetBlobReferenceSASRequestDto, options *armmachinelearning.RegistryDataReferencesClientGetBlobReferenceSASOptions) (resp azfake.Responder[armmachinelearning.RegistryDataReferencesClientGetBlobReferenceSASResponse], errResp azfake.ErrorResponder) +} + +// NewRegistryDataReferencesServerTransport creates a new instance of RegistryDataReferencesServerTransport with the provided implementation. +// The returned RegistryDataReferencesServerTransport instance is connected to an instance of armmachinelearning.RegistryDataReferencesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryDataReferencesServerTransport(srv *RegistryDataReferencesServer) *RegistryDataReferencesServerTransport { + return &RegistryDataReferencesServerTransport{srv: srv} +} + +// RegistryDataReferencesServerTransport connects instances of armmachinelearning.RegistryDataReferencesClient to instances of RegistryDataReferencesServer. +// Don't use this type directly, use NewRegistryDataReferencesServerTransport instead. +type RegistryDataReferencesServerTransport struct { + srv *RegistryDataReferencesServer +} + +// Do implements the policy.Transporter interface for RegistryDataReferencesServerTransport. +func (r *RegistryDataReferencesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryDataReferencesClient.GetBlobReferenceSAS": + resp, err = r.dispatchGetBlobReferenceSAS(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryDataReferencesServerTransport) dispatchGetBlobReferenceSAS(req *http.Request) (*http.Response, error) { + if r.srv.GetBlobReferenceSAS == nil { + return nil, &nonRetriableError{errors.New("fake for method GetBlobReferenceSAS not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/datareferences/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.GetBlobReferenceSASRequestDto](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.GetBlobReferenceSAS(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GetBlobReferenceSASResponseDto, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydataversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydataversions_server.go new file mode 100644 index 000000000000..339dba90730e --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrydataversions_server.go @@ -0,0 +1,385 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// RegistryDataVersionsServer is a fake server for instances of the armmachinelearning.RegistryDataVersionsClient type. +type RegistryDataVersionsServer struct { + // CreateOrGetStartPendingUpload is the fake for method RegistryDataVersionsClient.CreateOrGetStartPendingUpload + // HTTP status codes to indicate success: http.StatusOK + CreateOrGetStartPendingUpload func(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body armmachinelearning.PendingUploadRequestDto, options *armmachinelearning.RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions) (resp azfake.Responder[armmachinelearning.RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method RegistryDataVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body armmachinelearning.DataVersionBase, options *armmachinelearning.RegistryDataVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryDataVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryDataVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *armmachinelearning.RegistryDataVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryDataVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryDataVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *armmachinelearning.RegistryDataVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryDataVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryDataVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, name string, options *armmachinelearning.RegistryDataVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryDataVersionsClientListResponse]) +} + +// NewRegistryDataVersionsServerTransport creates a new instance of RegistryDataVersionsServerTransport with the provided implementation. +// The returned RegistryDataVersionsServerTransport instance is connected to an instance of armmachinelearning.RegistryDataVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryDataVersionsServerTransport(srv *RegistryDataVersionsServer) *RegistryDataVersionsServerTransport { + return &RegistryDataVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryDataVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryDataVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryDataVersionsClientListResponse]](), + } +} + +// RegistryDataVersionsServerTransport connects instances of armmachinelearning.RegistryDataVersionsClient to instances of RegistryDataVersionsServer. +// Don't use this type directly, use NewRegistryDataVersionsServerTransport instead. +type RegistryDataVersionsServerTransport struct { + srv *RegistryDataVersionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryDataVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryDataVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryDataVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryDataVersionsServerTransport. +func (r *RegistryDataVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryDataVersionsClient.CreateOrGetStartPendingUpload": + resp, err = r.dispatchCreateOrGetStartPendingUpload(req) + case "RegistryDataVersionsClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryDataVersionsClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryDataVersionsClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryDataVersionsClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryDataVersionsServerTransport) dispatchCreateOrGetStartPendingUpload(req *http.Request) (*http.Response, error) { + if r.srv.CreateOrGetStartPendingUpload == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrGetStartPendingUpload not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startPendingUpload` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PendingUploadRequestDto](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.CreateOrGetStartPendingUpload(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PendingUploadResponseDto, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryDataVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DataVersionBase](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryDataVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryDataVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, nameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DataVersionBase, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryDataVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/data/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("$tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.RegistryDataVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || tagsParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.RegistryDataVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + Tags: tagsParam, + ListViewType: listViewTypeParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, nameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryDataVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentcontainers_server.go new file mode 100644 index 000000000000..e92ef0a55464 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentcontainers_server.go @@ -0,0 +1,290 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistryEnvironmentContainersServer is a fake server for instances of the armmachinelearning.RegistryEnvironmentContainersClient type. +type RegistryEnvironmentContainersServer struct { + // BeginCreateOrUpdate is the fake for method RegistryEnvironmentContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, environmentName string, body armmachinelearning.EnvironmentContainer, options *armmachinelearning.RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryEnvironmentContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryEnvironmentContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *armmachinelearning.RegistryEnvironmentContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryEnvironmentContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryEnvironmentContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *armmachinelearning.RegistryEnvironmentContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryEnvironmentContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryEnvironmentContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armmachinelearning.RegistryEnvironmentContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryEnvironmentContainersClientListResponse]) +} + +// NewRegistryEnvironmentContainersServerTransport creates a new instance of RegistryEnvironmentContainersServerTransport with the provided implementation. +// The returned RegistryEnvironmentContainersServerTransport instance is connected to an instance of armmachinelearning.RegistryEnvironmentContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryEnvironmentContainersServerTransport(srv *RegistryEnvironmentContainersServer) *RegistryEnvironmentContainersServerTransport { + return &RegistryEnvironmentContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryEnvironmentContainersClientListResponse]](), + } +} + +// RegistryEnvironmentContainersServerTransport connects instances of armmachinelearning.RegistryEnvironmentContainersClient to instances of RegistryEnvironmentContainersServer. +// Don't use this type directly, use NewRegistryEnvironmentContainersServerTransport instead. +type RegistryEnvironmentContainersServerTransport struct { + srv *RegistryEnvironmentContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryEnvironmentContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryEnvironmentContainersServerTransport. +func (r *RegistryEnvironmentContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryEnvironmentContainersClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryEnvironmentContainersClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryEnvironmentContainersClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryEnvironmentContainersClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryEnvironmentContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.EnvironmentContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, environmentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryEnvironmentContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, environmentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryEnvironmentContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, environmentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EnvironmentContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryEnvironmentContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.RegistryEnvironmentContainersClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.RegistryEnvironmentContainersClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryEnvironmentContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentversions_server.go new file mode 100644 index 000000000000..abfd5ccf8583 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentversions_server.go @@ -0,0 +1,334 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// RegistryEnvironmentVersionsServer is a fake server for instances of the armmachinelearning.RegistryEnvironmentVersionsClient type. +type RegistryEnvironmentVersionsServer struct { + // BeginCreateOrUpdate is the fake for method RegistryEnvironmentVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, body armmachinelearning.EnvironmentVersion, options *armmachinelearning.RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryEnvironmentVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryEnvironmentVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *armmachinelearning.RegistryEnvironmentVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryEnvironmentVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryEnvironmentVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *armmachinelearning.RegistryEnvironmentVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryEnvironmentVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryEnvironmentVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, environmentName string, options *armmachinelearning.RegistryEnvironmentVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryEnvironmentVersionsClientListResponse]) +} + +// NewRegistryEnvironmentVersionsServerTransport creates a new instance of RegistryEnvironmentVersionsServerTransport with the provided implementation. +// The returned RegistryEnvironmentVersionsServerTransport instance is connected to an instance of armmachinelearning.RegistryEnvironmentVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryEnvironmentVersionsServerTransport(srv *RegistryEnvironmentVersionsServer) *RegistryEnvironmentVersionsServerTransport { + return &RegistryEnvironmentVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryEnvironmentVersionsClientListResponse]](), + } +} + +// RegistryEnvironmentVersionsServerTransport connects instances of armmachinelearning.RegistryEnvironmentVersionsClient to instances of RegistryEnvironmentVersionsServer. +// Don't use this type directly, use NewRegistryEnvironmentVersionsServerTransport instead. +type RegistryEnvironmentVersionsServerTransport struct { + srv *RegistryEnvironmentVersionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryEnvironmentVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryEnvironmentVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryEnvironmentVersionsServerTransport. +func (r *RegistryEnvironmentVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryEnvironmentVersionsClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryEnvironmentVersionsClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryEnvironmentVersionsClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryEnvironmentVersionsClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryEnvironmentVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.EnvironmentVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, environmentNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryEnvironmentVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, environmentNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryEnvironmentVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, environmentNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EnvironmentVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryEnvironmentVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) + if err != nil { + return nil, err + } + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + stageUnescaped, err := url.QueryUnescape(qp.Get("stage")) + if err != nil { + return nil, err + } + stageParam := getOptional(stageUnescaped) + var options *armmachinelearning.RegistryEnvironmentVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || listViewTypeParam != nil || stageParam != nil { + options = &armmachinelearning.RegistryEnvironmentVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + ListViewType: listViewTypeParam, + Stage: stageParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, environmentNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryEnvironmentVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelcontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelcontainers_server.go new file mode 100644 index 000000000000..d67a6d467c2f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelcontainers_server.go @@ -0,0 +1,290 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// RegistryModelContainersServer is a fake server for instances of the armmachinelearning.RegistryModelContainersClient type. +type RegistryModelContainersServer struct { + // BeginCreateOrUpdate is the fake for method RegistryModelContainersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, modelName string, body armmachinelearning.ModelContainer, options *armmachinelearning.RegistryModelContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryModelContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryModelContainersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *armmachinelearning.RegistryModelContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryModelContainersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryModelContainersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *armmachinelearning.RegistryModelContainersClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryModelContainersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryModelContainersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armmachinelearning.RegistryModelContainersClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryModelContainersClientListResponse]) +} + +// NewRegistryModelContainersServerTransport creates a new instance of RegistryModelContainersServerTransport with the provided implementation. +// The returned RegistryModelContainersServerTransport instance is connected to an instance of armmachinelearning.RegistryModelContainersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryModelContainersServerTransport(srv *RegistryModelContainersServer) *RegistryModelContainersServerTransport { + return &RegistryModelContainersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryModelContainersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryModelContainersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryModelContainersClientListResponse]](), + } +} + +// RegistryModelContainersServerTransport connects instances of armmachinelearning.RegistryModelContainersClient to instances of RegistryModelContainersServer. +// Don't use this type directly, use NewRegistryModelContainersServerTransport instead. +type RegistryModelContainersServerTransport struct { + srv *RegistryModelContainersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryModelContainersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryModelContainersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryModelContainersClientListResponse]] +} + +// Do implements the policy.Transporter interface for RegistryModelContainersServerTransport. +func (r *RegistryModelContainersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryModelContainersClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryModelContainersClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryModelContainersClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryModelContainersClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryModelContainersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ModelContainer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryModelContainersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryModelContainersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ModelContainer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryModelContainersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.RegistryModelContainersClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.RegistryModelContainersClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryModelContainersClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelversions_server.go new file mode 100644 index 000000000000..5a905f59424e --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelversions_server.go @@ -0,0 +1,467 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// RegistryModelVersionsServer is a fake server for instances of the armmachinelearning.RegistryModelVersionsClient type. +type RegistryModelVersionsServer struct { + // CreateOrGetStartPendingUpload is the fake for method RegistryModelVersionsClient.CreateOrGetStartPendingUpload + // HTTP status codes to indicate success: http.StatusOK + CreateOrGetStartPendingUpload func(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body armmachinelearning.PendingUploadRequestDto, options *armmachinelearning.RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions) (resp azfake.Responder[armmachinelearning.RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse], errResp azfake.ErrorResponder) + + // BeginCreateOrUpdate is the fake for method RegistryModelVersionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body armmachinelearning.ModelVersion, options *armmachinelearning.RegistryModelVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method RegistryModelVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *armmachinelearning.RegistryModelVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method RegistryModelVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *armmachinelearning.RegistryModelVersionsClientGetOptions) (resp azfake.Responder[armmachinelearning.RegistryModelVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method RegistryModelVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, modelName string, options *armmachinelearning.RegistryModelVersionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.RegistryModelVersionsClientListResponse]) + + // BeginPackage is the fake for method RegistryModelVersionsClient.BeginPackage + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginPackage func(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body armmachinelearning.PackageRequest, options *armmachinelearning.RegistryModelVersionsClientBeginPackageOptions) (resp azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientPackageResponse], errResp azfake.ErrorResponder) +} + +// NewRegistryModelVersionsServerTransport creates a new instance of RegistryModelVersionsServerTransport with the provided implementation. +// The returned RegistryModelVersionsServerTransport instance is connected to an instance of armmachinelearning.RegistryModelVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewRegistryModelVersionsServerTransport(srv *RegistryModelVersionsServer) *RegistryModelVersionsServerTransport { + return &RegistryModelVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.RegistryModelVersionsClientListResponse]](), + beginPackage: newTracker[azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientPackageResponse]](), + } +} + +// RegistryModelVersionsServerTransport connects instances of armmachinelearning.RegistryModelVersionsClient to instances of RegistryModelVersionsServer. +// Don't use this type directly, use NewRegistryModelVersionsServerTransport instead. +type RegistryModelVersionsServerTransport struct { + srv *RegistryModelVersionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.RegistryModelVersionsClientListResponse]] + beginPackage *tracker[azfake.PollerResponder[armmachinelearning.RegistryModelVersionsClientPackageResponse]] +} + +// Do implements the policy.Transporter interface for RegistryModelVersionsServerTransport. +func (r *RegistryModelVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "RegistryModelVersionsClient.CreateOrGetStartPendingUpload": + resp, err = r.dispatchCreateOrGetStartPendingUpload(req) + case "RegistryModelVersionsClient.BeginCreateOrUpdate": + resp, err = r.dispatchBeginCreateOrUpdate(req) + case "RegistryModelVersionsClient.BeginDelete": + resp, err = r.dispatchBeginDelete(req) + case "RegistryModelVersionsClient.Get": + resp, err = r.dispatchGet(req) + case "RegistryModelVersionsClient.NewListPager": + resp, err = r.dispatchNewListPager(req) + case "RegistryModelVersionsClient.BeginPackage": + resp, err = r.dispatchBeginPackage(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (r *RegistryModelVersionsServerTransport) dispatchCreateOrGetStartPendingUpload(req *http.Request) (*http.Response, error) { + if r.srv.CreateOrGetStartPendingUpload == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrGetStartPendingUpload not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startPendingUpload` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PendingUploadRequestDto](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.CreateOrGetStartPendingUpload(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PendingUploadResponseDto, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryModelVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if r.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := r.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ModelVersion](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + r.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + r.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + r.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (r *RegistryModelVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if r.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + r.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) + } + + return resp, nil +} + +func (r *RegistryModelVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if r.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ModelVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (r *RegistryModelVersionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if r.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := r.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + orderByUnescaped, err := url.QueryUnescape(qp.Get("$orderBy")) + if err != nil { + return nil, err + } + orderByParam := getOptional(orderByUnescaped) + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + versionUnescaped, err := url.QueryUnescape(qp.Get("version")) + if err != nil { + return nil, err + } + versionParam := getOptional(versionUnescaped) + descriptionUnescaped, err := url.QueryUnescape(qp.Get("description")) + if err != nil { + return nil, err + } + descriptionParam := getOptional(descriptionUnescaped) + tagsUnescaped, err := url.QueryUnescape(qp.Get("tags")) + if err != nil { + return nil, err + } + tagsParam := getOptional(tagsUnescaped) + propertiesUnescaped, err := url.QueryUnescape(qp.Get("properties")) + if err != nil { + return nil, err + } + propertiesParam := getOptional(propertiesUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.RegistryModelVersionsClientListOptions + if skipParam != nil || orderByParam != nil || topParam != nil || versionParam != nil || descriptionParam != nil || tagsParam != nil || propertiesParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.RegistryModelVersionsClientListOptions{ + Skip: skipParam, + OrderBy: orderByParam, + Top: topParam, + Version: versionParam, + Description: descriptionParam, + Tags: tagsParam, + Properties: propertiesParam, + ListViewType: listViewTypeParam, + } + } + resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, modelNameParam, options) + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.RegistryModelVersionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) + } + return resp, nil +} + +func (r *RegistryModelVersionsServerTransport) dispatchBeginPackage(req *http.Request) (*http.Response, error) { + if r.srv.BeginPackage == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPackage not implemented")} + } + beginPackage := r.beginPackage.get(req) + if beginPackage == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/models/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/package` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PackageRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) + if err != nil { + return nil, err + } + modelNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("modelName")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := r.srv.BeginPackage(req.Context(), resourceGroupNameParam, registryNameParam, modelNameParam, versionParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPackage = &respr + r.beginPackage.add(req, beginPackage) + } + + resp, err := server.PollerResponderNext(beginPackage, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + r.beginPackage.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPackage) { + r.beginPackage.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go new file mode 100644 index 000000000000..ffe3f67da2d2 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go @@ -0,0 +1,290 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// SchedulesServer is a fake server for instances of the armmachinelearning.SchedulesClient type. +type SchedulesServer struct { + // BeginCreateOrUpdate is the fake for method SchedulesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.Schedule, options *armmachinelearning.SchedulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.SchedulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method SchedulesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.SchedulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.SchedulesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SchedulesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.SchedulesClientGetOptions) (resp azfake.Responder[armmachinelearning.SchedulesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SchedulesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.SchedulesClientListOptions) (resp azfake.PagerResponder[armmachinelearning.SchedulesClientListResponse]) +} + +// NewSchedulesServerTransport creates a new instance of SchedulesServerTransport with the provided implementation. +// The returned SchedulesServerTransport instance is connected to an instance of armmachinelearning.SchedulesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSchedulesServerTransport(srv *SchedulesServer) *SchedulesServerTransport { + return &SchedulesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.SchedulesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.SchedulesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.SchedulesClientListResponse]](), + } +} + +// SchedulesServerTransport connects instances of armmachinelearning.SchedulesClient to instances of SchedulesServer. +// Don't use this type directly, use NewSchedulesServerTransport instead. +type SchedulesServerTransport struct { + srv *SchedulesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.SchedulesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.SchedulesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.SchedulesClientListResponse]] +} + +// Do implements the policy.Transporter interface for SchedulesServerTransport. +func (s *SchedulesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "SchedulesClient.BeginCreateOrUpdate": + resp, err = s.dispatchBeginCreateOrUpdate(req) + case "SchedulesClient.BeginDelete": + resp, err = s.dispatchBeginDelete(req) + case "SchedulesClient.Get": + resp, err = s.dispatchGet(req) + case "SchedulesClient.NewListPager": + resp, err = s.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *SchedulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/schedules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.Schedule](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *SchedulesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/schedules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SchedulesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/schedules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Schedule, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SchedulesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := s.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/schedules` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + listViewTypeUnescaped, err := url.QueryUnescape(qp.Get("listViewType")) + if err != nil { + return nil, err + } + listViewTypeParam := getOptional(armmachinelearning.ScheduleListViewType(listViewTypeUnescaped)) + var options *armmachinelearning.SchedulesClientListOptions + if skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.SchedulesClientListOptions{ + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.SchedulesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go new file mode 100644 index 000000000000..6e5c40ef1b4f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go @@ -0,0 +1,408 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "strings" + "sync" +) + +// ServerFactory is a fake server for instances of the armmachinelearning.ClientFactory type. +type ServerFactory struct { + BatchDeploymentsServer BatchDeploymentsServer + BatchEndpointsServer BatchEndpointsServer + CapacityReservationGroupsServer CapacityReservationGroupsServer + CodeContainersServer CodeContainersServer + CodeVersionsServer CodeVersionsServer + ComponentContainersServer ComponentContainersServer + ComponentVersionsServer ComponentVersionsServer + ComputeServer ComputeServer + DataContainersServer DataContainersServer + DataVersionsServer DataVersionsServer + DatastoresServer DatastoresServer + EnvironmentContainersServer EnvironmentContainersServer + EnvironmentVersionsServer EnvironmentVersionsServer + FeaturesServer FeaturesServer + FeaturesetContainersServer FeaturesetContainersServer + FeaturesetVersionsServer FeaturesetVersionsServer + FeaturestoreEntityContainersServer FeaturestoreEntityContainersServer + FeaturestoreEntityVersionsServer FeaturestoreEntityVersionsServer + InferenceEndpointsServer InferenceEndpointsServer + InferenceGroupsServer InferenceGroupsServer + InferencePoolsServer InferencePoolsServer + JobsServer JobsServer + LabelingJobsServer LabelingJobsServer + ManagedNetworkProvisionsServer ManagedNetworkProvisionsServer + ManagedNetworkSettingsRuleServer ManagedNetworkSettingsRuleServer + ModelContainersServer ModelContainersServer + ModelVersionsServer ModelVersionsServer + OnlineDeploymentsServer OnlineDeploymentsServer + OnlineEndpointsServer OnlineEndpointsServer + OperationsServer OperationsServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + QuotasServer QuotasServer + RegistriesServer RegistriesServer + RegistryCodeContainersServer RegistryCodeContainersServer + RegistryCodeVersionsServer RegistryCodeVersionsServer + RegistryComponentContainersServer RegistryComponentContainersServer + RegistryComponentVersionsServer RegistryComponentVersionsServer + RegistryDataContainersServer RegistryDataContainersServer + RegistryDataReferencesServer RegistryDataReferencesServer + RegistryDataVersionsServer RegistryDataVersionsServer + RegistryEnvironmentContainersServer RegistryEnvironmentContainersServer + RegistryEnvironmentVersionsServer RegistryEnvironmentVersionsServer + RegistryModelContainersServer RegistryModelContainersServer + RegistryModelVersionsServer RegistryModelVersionsServer + SchedulesServer SchedulesServer + ServerlessEndpointsServer ServerlessEndpointsServer + UsagesServer UsagesServer + VirtualMachineSizesServer VirtualMachineSizesServer + WorkspaceConnectionsServer WorkspaceConnectionsServer + WorkspaceFeaturesServer WorkspaceFeaturesServer + WorkspacesServer WorkspacesServer +} + +// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. +// The returned ServerFactoryTransport instance is connected to an instance of armmachinelearning.ClientFactory via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { + return &ServerFactoryTransport{ + srv: srv, + } +} + +// ServerFactoryTransport connects instances of armmachinelearning.ClientFactory to instances of ServerFactory. +// Don't use this type directly, use NewServerFactoryTransport instead. +type ServerFactoryTransport struct { + srv *ServerFactory + trMu sync.Mutex + trBatchDeploymentsServer *BatchDeploymentsServerTransport + trBatchEndpointsServer *BatchEndpointsServerTransport + trCapacityReservationGroupsServer *CapacityReservationGroupsServerTransport + trCodeContainersServer *CodeContainersServerTransport + trCodeVersionsServer *CodeVersionsServerTransport + trComponentContainersServer *ComponentContainersServerTransport + trComponentVersionsServer *ComponentVersionsServerTransport + trComputeServer *ComputeServerTransport + trDataContainersServer *DataContainersServerTransport + trDataVersionsServer *DataVersionsServerTransport + trDatastoresServer *DatastoresServerTransport + trEnvironmentContainersServer *EnvironmentContainersServerTransport + trEnvironmentVersionsServer *EnvironmentVersionsServerTransport + trFeaturesServer *FeaturesServerTransport + trFeaturesetContainersServer *FeaturesetContainersServerTransport + trFeaturesetVersionsServer *FeaturesetVersionsServerTransport + trFeaturestoreEntityContainersServer *FeaturestoreEntityContainersServerTransport + trFeaturestoreEntityVersionsServer *FeaturestoreEntityVersionsServerTransport + trInferenceEndpointsServer *InferenceEndpointsServerTransport + trInferenceGroupsServer *InferenceGroupsServerTransport + trInferencePoolsServer *InferencePoolsServerTransport + trJobsServer *JobsServerTransport + trLabelingJobsServer *LabelingJobsServerTransport + trManagedNetworkProvisionsServer *ManagedNetworkProvisionsServerTransport + trManagedNetworkSettingsRuleServer *ManagedNetworkSettingsRuleServerTransport + trModelContainersServer *ModelContainersServerTransport + trModelVersionsServer *ModelVersionsServerTransport + trOnlineDeploymentsServer *OnlineDeploymentsServerTransport + trOnlineEndpointsServer *OnlineEndpointsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQuotasServer *QuotasServerTransport + trRegistriesServer *RegistriesServerTransport + trRegistryCodeContainersServer *RegistryCodeContainersServerTransport + trRegistryCodeVersionsServer *RegistryCodeVersionsServerTransport + trRegistryComponentContainersServer *RegistryComponentContainersServerTransport + trRegistryComponentVersionsServer *RegistryComponentVersionsServerTransport + trRegistryDataContainersServer *RegistryDataContainersServerTransport + trRegistryDataReferencesServer *RegistryDataReferencesServerTransport + trRegistryDataVersionsServer *RegistryDataVersionsServerTransport + trRegistryEnvironmentContainersServer *RegistryEnvironmentContainersServerTransport + trRegistryEnvironmentVersionsServer *RegistryEnvironmentVersionsServerTransport + trRegistryModelContainersServer *RegistryModelContainersServerTransport + trRegistryModelVersionsServer *RegistryModelVersionsServerTransport + trSchedulesServer *SchedulesServerTransport + trServerlessEndpointsServer *ServerlessEndpointsServerTransport + trUsagesServer *UsagesServerTransport + trVirtualMachineSizesServer *VirtualMachineSizesServerTransport + trWorkspaceConnectionsServer *WorkspaceConnectionsServerTransport + trWorkspaceFeaturesServer *WorkspaceFeaturesServerTransport + trWorkspacesServer *WorkspacesServerTransport +} + +// Do implements the policy.Transporter interface for ServerFactoryTransport. +func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + client := method[:strings.Index(method, ".")] + var resp *http.Response + var err error + + switch client { + case "BatchDeploymentsClient": + initServer(s, &s.trBatchDeploymentsServer, func() *BatchDeploymentsServerTransport { + return NewBatchDeploymentsServerTransport(&s.srv.BatchDeploymentsServer) + }) + resp, err = s.trBatchDeploymentsServer.Do(req) + case "BatchEndpointsClient": + initServer(s, &s.trBatchEndpointsServer, func() *BatchEndpointsServerTransport { + return NewBatchEndpointsServerTransport(&s.srv.BatchEndpointsServer) + }) + resp, err = s.trBatchEndpointsServer.Do(req) + case "CapacityReservationGroupsClient": + initServer(s, &s.trCapacityReservationGroupsServer, func() *CapacityReservationGroupsServerTransport { + return NewCapacityReservationGroupsServerTransport(&s.srv.CapacityReservationGroupsServer) + }) + resp, err = s.trCapacityReservationGroupsServer.Do(req) + case "CodeContainersClient": + initServer(s, &s.trCodeContainersServer, func() *CodeContainersServerTransport { + return NewCodeContainersServerTransport(&s.srv.CodeContainersServer) + }) + resp, err = s.trCodeContainersServer.Do(req) + case "CodeVersionsClient": + initServer(s, &s.trCodeVersionsServer, func() *CodeVersionsServerTransport { return NewCodeVersionsServerTransport(&s.srv.CodeVersionsServer) }) + resp, err = s.trCodeVersionsServer.Do(req) + case "ComponentContainersClient": + initServer(s, &s.trComponentContainersServer, func() *ComponentContainersServerTransport { + return NewComponentContainersServerTransport(&s.srv.ComponentContainersServer) + }) + resp, err = s.trComponentContainersServer.Do(req) + case "ComponentVersionsClient": + initServer(s, &s.trComponentVersionsServer, func() *ComponentVersionsServerTransport { + return NewComponentVersionsServerTransport(&s.srv.ComponentVersionsServer) + }) + resp, err = s.trComponentVersionsServer.Do(req) + case "ComputeClient": + initServer(s, &s.trComputeServer, func() *ComputeServerTransport { return NewComputeServerTransport(&s.srv.ComputeServer) }) + resp, err = s.trComputeServer.Do(req) + case "DataContainersClient": + initServer(s, &s.trDataContainersServer, func() *DataContainersServerTransport { + return NewDataContainersServerTransport(&s.srv.DataContainersServer) + }) + resp, err = s.trDataContainersServer.Do(req) + case "DataVersionsClient": + initServer(s, &s.trDataVersionsServer, func() *DataVersionsServerTransport { return NewDataVersionsServerTransport(&s.srv.DataVersionsServer) }) + resp, err = s.trDataVersionsServer.Do(req) + case "DatastoresClient": + initServer(s, &s.trDatastoresServer, func() *DatastoresServerTransport { return NewDatastoresServerTransport(&s.srv.DatastoresServer) }) + resp, err = s.trDatastoresServer.Do(req) + case "EnvironmentContainersClient": + initServer(s, &s.trEnvironmentContainersServer, func() *EnvironmentContainersServerTransport { + return NewEnvironmentContainersServerTransport(&s.srv.EnvironmentContainersServer) + }) + resp, err = s.trEnvironmentContainersServer.Do(req) + case "EnvironmentVersionsClient": + initServer(s, &s.trEnvironmentVersionsServer, func() *EnvironmentVersionsServerTransport { + return NewEnvironmentVersionsServerTransport(&s.srv.EnvironmentVersionsServer) + }) + resp, err = s.trEnvironmentVersionsServer.Do(req) + case "FeaturesClient": + initServer(s, &s.trFeaturesServer, func() *FeaturesServerTransport { return NewFeaturesServerTransport(&s.srv.FeaturesServer) }) + resp, err = s.trFeaturesServer.Do(req) + case "FeaturesetContainersClient": + initServer(s, &s.trFeaturesetContainersServer, func() *FeaturesetContainersServerTransport { + return NewFeaturesetContainersServerTransport(&s.srv.FeaturesetContainersServer) + }) + resp, err = s.trFeaturesetContainersServer.Do(req) + case "FeaturesetVersionsClient": + initServer(s, &s.trFeaturesetVersionsServer, func() *FeaturesetVersionsServerTransport { + return NewFeaturesetVersionsServerTransport(&s.srv.FeaturesetVersionsServer) + }) + resp, err = s.trFeaturesetVersionsServer.Do(req) + case "FeaturestoreEntityContainersClient": + initServer(s, &s.trFeaturestoreEntityContainersServer, func() *FeaturestoreEntityContainersServerTransport { + return NewFeaturestoreEntityContainersServerTransport(&s.srv.FeaturestoreEntityContainersServer) + }) + resp, err = s.trFeaturestoreEntityContainersServer.Do(req) + case "FeaturestoreEntityVersionsClient": + initServer(s, &s.trFeaturestoreEntityVersionsServer, func() *FeaturestoreEntityVersionsServerTransport { + return NewFeaturestoreEntityVersionsServerTransport(&s.srv.FeaturestoreEntityVersionsServer) + }) + resp, err = s.trFeaturestoreEntityVersionsServer.Do(req) + case "InferenceEndpointsClient": + initServer(s, &s.trInferenceEndpointsServer, func() *InferenceEndpointsServerTransport { + return NewInferenceEndpointsServerTransport(&s.srv.InferenceEndpointsServer) + }) + resp, err = s.trInferenceEndpointsServer.Do(req) + case "InferenceGroupsClient": + initServer(s, &s.trInferenceGroupsServer, func() *InferenceGroupsServerTransport { + return NewInferenceGroupsServerTransport(&s.srv.InferenceGroupsServer) + }) + resp, err = s.trInferenceGroupsServer.Do(req) + case "InferencePoolsClient": + initServer(s, &s.trInferencePoolsServer, func() *InferencePoolsServerTransport { + return NewInferencePoolsServerTransport(&s.srv.InferencePoolsServer) + }) + resp, err = s.trInferencePoolsServer.Do(req) + case "JobsClient": + initServer(s, &s.trJobsServer, func() *JobsServerTransport { return NewJobsServerTransport(&s.srv.JobsServer) }) + resp, err = s.trJobsServer.Do(req) + case "LabelingJobsClient": + initServer(s, &s.trLabelingJobsServer, func() *LabelingJobsServerTransport { return NewLabelingJobsServerTransport(&s.srv.LabelingJobsServer) }) + resp, err = s.trLabelingJobsServer.Do(req) + case "ManagedNetworkProvisionsClient": + initServer(s, &s.trManagedNetworkProvisionsServer, func() *ManagedNetworkProvisionsServerTransport { + return NewManagedNetworkProvisionsServerTransport(&s.srv.ManagedNetworkProvisionsServer) + }) + resp, err = s.trManagedNetworkProvisionsServer.Do(req) + case "ManagedNetworkSettingsRuleClient": + initServer(s, &s.trManagedNetworkSettingsRuleServer, func() *ManagedNetworkSettingsRuleServerTransport { + return NewManagedNetworkSettingsRuleServerTransport(&s.srv.ManagedNetworkSettingsRuleServer) + }) + resp, err = s.trManagedNetworkSettingsRuleServer.Do(req) + case "ModelContainersClient": + initServer(s, &s.trModelContainersServer, func() *ModelContainersServerTransport { + return NewModelContainersServerTransport(&s.srv.ModelContainersServer) + }) + resp, err = s.trModelContainersServer.Do(req) + case "ModelVersionsClient": + initServer(s, &s.trModelVersionsServer, func() *ModelVersionsServerTransport { + return NewModelVersionsServerTransport(&s.srv.ModelVersionsServer) + }) + resp, err = s.trModelVersionsServer.Do(req) + case "OnlineDeploymentsClient": + initServer(s, &s.trOnlineDeploymentsServer, func() *OnlineDeploymentsServerTransport { + return NewOnlineDeploymentsServerTransport(&s.srv.OnlineDeploymentsServer) + }) + resp, err = s.trOnlineDeploymentsServer.Do(req) + case "OnlineEndpointsClient": + initServer(s, &s.trOnlineEndpointsServer, func() *OnlineEndpointsServerTransport { + return NewOnlineEndpointsServerTransport(&s.srv.OnlineEndpointsServer) + }) + resp, err = s.trOnlineEndpointsServer.Do(req) + case "OperationsClient": + initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) + resp, err = s.trOperationsServer.Do(req) + case "PrivateEndpointConnectionsClient": + initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { + return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) + }) + resp, err = s.trPrivateEndpointConnectionsServer.Do(req) + case "PrivateLinkResourcesClient": + initServer(s, &s.trPrivateLinkResourcesServer, func() *PrivateLinkResourcesServerTransport { + return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) + }) + resp, err = s.trPrivateLinkResourcesServer.Do(req) + case "QuotasClient": + initServer(s, &s.trQuotasServer, func() *QuotasServerTransport { return NewQuotasServerTransport(&s.srv.QuotasServer) }) + resp, err = s.trQuotasServer.Do(req) + case "RegistriesClient": + initServer(s, &s.trRegistriesServer, func() *RegistriesServerTransport { return NewRegistriesServerTransport(&s.srv.RegistriesServer) }) + resp, err = s.trRegistriesServer.Do(req) + case "RegistryCodeContainersClient": + initServer(s, &s.trRegistryCodeContainersServer, func() *RegistryCodeContainersServerTransport { + return NewRegistryCodeContainersServerTransport(&s.srv.RegistryCodeContainersServer) + }) + resp, err = s.trRegistryCodeContainersServer.Do(req) + case "RegistryCodeVersionsClient": + initServer(s, &s.trRegistryCodeVersionsServer, func() *RegistryCodeVersionsServerTransport { + return NewRegistryCodeVersionsServerTransport(&s.srv.RegistryCodeVersionsServer) + }) + resp, err = s.trRegistryCodeVersionsServer.Do(req) + case "RegistryComponentContainersClient": + initServer(s, &s.trRegistryComponentContainersServer, func() *RegistryComponentContainersServerTransport { + return NewRegistryComponentContainersServerTransport(&s.srv.RegistryComponentContainersServer) + }) + resp, err = s.trRegistryComponentContainersServer.Do(req) + case "RegistryComponentVersionsClient": + initServer(s, &s.trRegistryComponentVersionsServer, func() *RegistryComponentVersionsServerTransport { + return NewRegistryComponentVersionsServerTransport(&s.srv.RegistryComponentVersionsServer) + }) + resp, err = s.trRegistryComponentVersionsServer.Do(req) + case "RegistryDataContainersClient": + initServer(s, &s.trRegistryDataContainersServer, func() *RegistryDataContainersServerTransport { + return NewRegistryDataContainersServerTransport(&s.srv.RegistryDataContainersServer) + }) + resp, err = s.trRegistryDataContainersServer.Do(req) + case "RegistryDataReferencesClient": + initServer(s, &s.trRegistryDataReferencesServer, func() *RegistryDataReferencesServerTransport { + return NewRegistryDataReferencesServerTransport(&s.srv.RegistryDataReferencesServer) + }) + resp, err = s.trRegistryDataReferencesServer.Do(req) + case "RegistryDataVersionsClient": + initServer(s, &s.trRegistryDataVersionsServer, func() *RegistryDataVersionsServerTransport { + return NewRegistryDataVersionsServerTransport(&s.srv.RegistryDataVersionsServer) + }) + resp, err = s.trRegistryDataVersionsServer.Do(req) + case "RegistryEnvironmentContainersClient": + initServer(s, &s.trRegistryEnvironmentContainersServer, func() *RegistryEnvironmentContainersServerTransport { + return NewRegistryEnvironmentContainersServerTransport(&s.srv.RegistryEnvironmentContainersServer) + }) + resp, err = s.trRegistryEnvironmentContainersServer.Do(req) + case "RegistryEnvironmentVersionsClient": + initServer(s, &s.trRegistryEnvironmentVersionsServer, func() *RegistryEnvironmentVersionsServerTransport { + return NewRegistryEnvironmentVersionsServerTransport(&s.srv.RegistryEnvironmentVersionsServer) + }) + resp, err = s.trRegistryEnvironmentVersionsServer.Do(req) + case "RegistryModelContainersClient": + initServer(s, &s.trRegistryModelContainersServer, func() *RegistryModelContainersServerTransport { + return NewRegistryModelContainersServerTransport(&s.srv.RegistryModelContainersServer) + }) + resp, err = s.trRegistryModelContainersServer.Do(req) + case "RegistryModelVersionsClient": + initServer(s, &s.trRegistryModelVersionsServer, func() *RegistryModelVersionsServerTransport { + return NewRegistryModelVersionsServerTransport(&s.srv.RegistryModelVersionsServer) + }) + resp, err = s.trRegistryModelVersionsServer.Do(req) + case "SchedulesClient": + initServer(s, &s.trSchedulesServer, func() *SchedulesServerTransport { return NewSchedulesServerTransport(&s.srv.SchedulesServer) }) + resp, err = s.trSchedulesServer.Do(req) + case "ServerlessEndpointsClient": + initServer(s, &s.trServerlessEndpointsServer, func() *ServerlessEndpointsServerTransport { + return NewServerlessEndpointsServerTransport(&s.srv.ServerlessEndpointsServer) + }) + resp, err = s.trServerlessEndpointsServer.Do(req) + case "UsagesClient": + initServer(s, &s.trUsagesServer, func() *UsagesServerTransport { return NewUsagesServerTransport(&s.srv.UsagesServer) }) + resp, err = s.trUsagesServer.Do(req) + case "VirtualMachineSizesClient": + initServer(s, &s.trVirtualMachineSizesServer, func() *VirtualMachineSizesServerTransport { + return NewVirtualMachineSizesServerTransport(&s.srv.VirtualMachineSizesServer) + }) + resp, err = s.trVirtualMachineSizesServer.Do(req) + case "WorkspaceConnectionsClient": + initServer(s, &s.trWorkspaceConnectionsServer, func() *WorkspaceConnectionsServerTransport { + return NewWorkspaceConnectionsServerTransport(&s.srv.WorkspaceConnectionsServer) + }) + resp, err = s.trWorkspaceConnectionsServer.Do(req) + case "WorkspaceFeaturesClient": + initServer(s, &s.trWorkspaceFeaturesServer, func() *WorkspaceFeaturesServerTransport { + return NewWorkspaceFeaturesServerTransport(&s.srv.WorkspaceFeaturesServer) + }) + resp, err = s.trWorkspaceFeaturesServer.Do(req) + case "WorkspacesClient": + initServer(s, &s.trWorkspacesServer, func() *WorkspacesServerTransport { return NewWorkspacesServerTransport(&s.srv.WorkspacesServer) }) + resp, err = s.trWorkspacesServer.Do(req) + default: + err = fmt.Errorf("unhandled client %s", client) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { + s.trMu.Lock() + if *dst == nil { + *dst = src() + } + s.trMu.Unlock() +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/serverlessendpoints_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/serverlessendpoints_server.go new file mode 100644 index 000000000000..0bd853923377 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/serverlessendpoints_server.go @@ -0,0 +1,490 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// ServerlessEndpointsServer is a fake server for instances of the armmachinelearning.ServerlessEndpointsClient type. +type ServerlessEndpointsServer struct { + // BeginCreateOrUpdate is the fake for method ServerlessEndpointsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.ServerlessEndpoint, options *armmachinelearning.ServerlessEndpointsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ServerlessEndpointsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ServerlessEndpointsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ServerlessEndpointsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ServerlessEndpointsClientGetOptions) (resp azfake.Responder[armmachinelearning.ServerlessEndpointsClientGetResponse], errResp azfake.ErrorResponder) + + // GetStatus is the fake for method ServerlessEndpointsClient.GetStatus + // HTTP status codes to indicate success: http.StatusOK + GetStatus func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ServerlessEndpointsClientGetStatusOptions) (resp azfake.Responder[armmachinelearning.ServerlessEndpointsClientGetStatusResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ServerlessEndpointsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.ServerlessEndpointsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.ServerlessEndpointsClientListResponse]) + + // ListKeys is the fake for method ServerlessEndpointsClient.ListKeys + // HTTP status codes to indicate success: http.StatusOK + ListKeys func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.ServerlessEndpointsClientListKeysOptions) (resp azfake.Responder[armmachinelearning.ServerlessEndpointsClientListKeysResponse], errResp azfake.ErrorResponder) + + // BeginRegenerateKeys is the fake for method ServerlessEndpointsClient.BeginRegenerateKeys + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginRegenerateKeys func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.RegenerateEndpointKeysRequest, options *armmachinelearning.ServerlessEndpointsClientBeginRegenerateKeysOptions) (resp azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientRegenerateKeysResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method ServerlessEndpointsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.PartialMinimalTrackedResourceWithSKUAndIdentity, options *armmachinelearning.ServerlessEndpointsClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewServerlessEndpointsServerTransport creates a new instance of ServerlessEndpointsServerTransport with the provided implementation. +// The returned ServerlessEndpointsServerTransport instance is connected to an instance of armmachinelearning.ServerlessEndpointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServerlessEndpointsServerTransport(srv *ServerlessEndpointsServer) *ServerlessEndpointsServerTransport { + return &ServerlessEndpointsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ServerlessEndpointsClientListResponse]](), + beginRegenerateKeys: newTracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientRegenerateKeysResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientUpdateResponse]](), + } +} + +// ServerlessEndpointsServerTransport connects instances of armmachinelearning.ServerlessEndpointsClient to instances of ServerlessEndpointsServer. +// Don't use this type directly, use NewServerlessEndpointsServerTransport instead. +type ServerlessEndpointsServerTransport struct { + srv *ServerlessEndpointsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.ServerlessEndpointsClientListResponse]] + beginRegenerateKeys *tracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientRegenerateKeysResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.ServerlessEndpointsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for ServerlessEndpointsServerTransport. +func (s *ServerlessEndpointsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ServerlessEndpointsClient.BeginCreateOrUpdate": + resp, err = s.dispatchBeginCreateOrUpdate(req) + case "ServerlessEndpointsClient.BeginDelete": + resp, err = s.dispatchBeginDelete(req) + case "ServerlessEndpointsClient.Get": + resp, err = s.dispatchGet(req) + case "ServerlessEndpointsClient.GetStatus": + resp, err = s.dispatchGetStatus(req) + case "ServerlessEndpointsClient.NewListPager": + resp, err = s.dispatchNewListPager(req) + case "ServerlessEndpointsClient.ListKeys": + resp, err = s.dispatchListKeys(req) + case "ServerlessEndpointsClient.BeginRegenerateKeys": + resp, err = s.dispatchBeginRegenerateKeys(req) + case "ServerlessEndpointsClient.BeginUpdate": + resp, err = s.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.ServerlessEndpoint](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServerlessEndpoint, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchGetStatus(req *http.Request) (*http.Response, error) { + if s.srv.GetStatus == nil { + return nil, &nonRetriableError{errors.New("fake for method GetStatus not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getStatus` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.GetStatus(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServerlessEndpointStatus, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := s.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.ServerlessEndpointsClientListOptions + if skipParam != nil { + options = &armmachinelearning.ServerlessEndpointsClientListOptions{ + Skip: skipParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.ServerlessEndpointsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) + } + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchListKeys(req *http.Request) (*http.Response, error) { + if s.srv.ListKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.ListKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EndpointAuthKeys, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchBeginRegenerateKeys(req *http.Request) (*http.Response, error) { + if s.srv.BeginRegenerateKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRegenerateKeys not implemented")} + } + beginRegenerateKeys := s.beginRegenerateKeys.get(req) + if beginRegenerateKeys == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regenerateKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.RegenerateEndpointKeysRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginRegenerateKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRegenerateKeys = &respr + s.beginRegenerateKeys.add(req, beginRegenerateKeys) + } + + resp, err := server.PollerResponderNext(beginRegenerateKeys, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginRegenerateKeys.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRegenerateKeys) { + s.beginRegenerateKeys.remove(req) + } + + return resp, nil +} + +func (s *ServerlessEndpointsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := s.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serverlessEndpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.PartialMinimalTrackedResourceWithSKUAndIdentity](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + s.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + s.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/time_rfc3339.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/time_rfc3339.go new file mode 100644 index 000000000000..b0535a7b63e6 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/time_rfc3339.go @@ -0,0 +1,86 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +const ( + utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` + utcDateTime = "2006-01-02T15:04:05.999999999" + dateTimeJSON = `"` + time.RFC3339Nano + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcDateTimeJSON + if tzOffsetRegex.Match(data) { + layout = dateTimeJSON + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + layout := utcDateTime + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go new file mode 100644 index 000000000000..d4f9349cf140 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go @@ -0,0 +1,108 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// UsagesServer is a fake server for instances of the armmachinelearning.UsagesClient type. +type UsagesServer struct { + // NewListPager is the fake for method UsagesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(location string, options *armmachinelearning.UsagesClientListOptions) (resp azfake.PagerResponder[armmachinelearning.UsagesClientListResponse]) +} + +// NewUsagesServerTransport creates a new instance of UsagesServerTransport with the provided implementation. +// The returned UsagesServerTransport instance is connected to an instance of armmachinelearning.UsagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewUsagesServerTransport(srv *UsagesServer) *UsagesServerTransport { + return &UsagesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.UsagesClientListResponse]](), + } +} + +// UsagesServerTransport connects instances of armmachinelearning.UsagesClient to instances of UsagesServer. +// Don't use this type directly, use NewUsagesServerTransport instead. +type UsagesServerTransport struct { + srv *UsagesServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.UsagesClientListResponse]] +} + +// Do implements the policy.Transporter interface for UsagesServerTransport. +func (u *UsagesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "UsagesClient.NewListPager": + resp, err = u.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if u.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := u.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/usages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + resp := u.srv.NewListPager(locationParam, nil) + newListPager = &resp + u.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.UsagesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + u.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + u.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go new file mode 100644 index 000000000000..7df82b07e0de --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go @@ -0,0 +1,96 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// VirtualMachineSizesServer is a fake server for instances of the armmachinelearning.VirtualMachineSizesClient type. +type VirtualMachineSizesServer struct { + // List is the fake for method VirtualMachineSizesClient.List + // HTTP status codes to indicate success: http.StatusOK + List func(ctx context.Context, location string, options *armmachinelearning.VirtualMachineSizesClientListOptions) (resp azfake.Responder[armmachinelearning.VirtualMachineSizesClientListResponse], errResp azfake.ErrorResponder) +} + +// NewVirtualMachineSizesServerTransport creates a new instance of VirtualMachineSizesServerTransport with the provided implementation. +// The returned VirtualMachineSizesServerTransport instance is connected to an instance of armmachinelearning.VirtualMachineSizesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewVirtualMachineSizesServerTransport(srv *VirtualMachineSizesServer) *VirtualMachineSizesServerTransport { + return &VirtualMachineSizesServerTransport{srv: srv} +} + +// VirtualMachineSizesServerTransport connects instances of armmachinelearning.VirtualMachineSizesClient to instances of VirtualMachineSizesServer. +// Don't use this type directly, use NewVirtualMachineSizesServerTransport instead. +type VirtualMachineSizesServerTransport struct { + srv *VirtualMachineSizesServer +} + +// Do implements the policy.Transporter interface for VirtualMachineSizesServerTransport. +func (v *VirtualMachineSizesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "VirtualMachineSizesClient.List": + resp, err = v.dispatchList(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (v *VirtualMachineSizesServerTransport) dispatchList(req *http.Request) (*http.Response, error) { + if v.srv.List == nil { + return nil, &nonRetriableError{errors.New("fake for method List not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/vmSizes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.List(req.Context(), locationParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).VirtualMachineSizeListResult, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go new file mode 100644 index 000000000000..18122bcdda09 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go @@ -0,0 +1,457 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "reflect" + "regexp" +) + +// WorkspaceConnectionsServer is a fake server for instances of the armmachinelearning.WorkspaceConnectionsClient type. +type WorkspaceConnectionsServer struct { + // Create is the fake for method WorkspaceConnectionsClient.Create + // HTTP status codes to indicate success: http.StatusOK + Create func(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *armmachinelearning.WorkspaceConnectionsClientCreateOptions) (resp azfake.Responder[armmachinelearning.WorkspaceConnectionsClientCreateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method WorkspaceConnectionsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *armmachinelearning.WorkspaceConnectionsClientDeleteOptions) (resp azfake.Responder[armmachinelearning.WorkspaceConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method WorkspaceConnectionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *armmachinelearning.WorkspaceConnectionsClientGetOptions) (resp azfake.Responder[armmachinelearning.WorkspaceConnectionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method WorkspaceConnectionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspaceConnectionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.WorkspaceConnectionsClientListResponse]) + + // ListSecrets is the fake for method WorkspaceConnectionsClient.ListSecrets + // HTTP status codes to indicate success: http.StatusOK + ListSecrets func(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *armmachinelearning.WorkspaceConnectionsClientListSecretsOptions) (resp azfake.Responder[armmachinelearning.WorkspaceConnectionsClientListSecretsResponse], errResp azfake.ErrorResponder) + + // BeginTestConnection is the fake for method WorkspaceConnectionsClient.BeginTestConnection + // HTTP status codes to indicate success: http.StatusAccepted + BeginTestConnection func(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *armmachinelearning.WorkspaceConnectionsClientBeginTestConnectionOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspaceConnectionsClientTestConnectionResponse], errResp azfake.ErrorResponder) + + // Update is the fake for method WorkspaceConnectionsClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *armmachinelearning.WorkspaceConnectionsClientUpdateOptions) (resp azfake.Responder[armmachinelearning.WorkspaceConnectionsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewWorkspaceConnectionsServerTransport creates a new instance of WorkspaceConnectionsServerTransport with the provided implementation. +// The returned WorkspaceConnectionsServerTransport instance is connected to an instance of armmachinelearning.WorkspaceConnectionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewWorkspaceConnectionsServerTransport(srv *WorkspaceConnectionsServer) *WorkspaceConnectionsServerTransport { + return &WorkspaceConnectionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.WorkspaceConnectionsClientListResponse]](), + beginTestConnection: newTracker[azfake.PollerResponder[armmachinelearning.WorkspaceConnectionsClientTestConnectionResponse]](), + } +} + +// WorkspaceConnectionsServerTransport connects instances of armmachinelearning.WorkspaceConnectionsClient to instances of WorkspaceConnectionsServer. +// Don't use this type directly, use NewWorkspaceConnectionsServerTransport instead. +type WorkspaceConnectionsServerTransport struct { + srv *WorkspaceConnectionsServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.WorkspaceConnectionsClientListResponse]] + beginTestConnection *tracker[azfake.PollerResponder[armmachinelearning.WorkspaceConnectionsClientTestConnectionResponse]] +} + +// Do implements the policy.Transporter interface for WorkspaceConnectionsServerTransport. +func (w *WorkspaceConnectionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "WorkspaceConnectionsClient.Create": + resp, err = w.dispatchCreate(req) + case "WorkspaceConnectionsClient.Delete": + resp, err = w.dispatchDelete(req) + case "WorkspaceConnectionsClient.Get": + resp, err = w.dispatchGet(req) + case "WorkspaceConnectionsClient.NewListPager": + resp, err = w.dispatchNewListPager(req) + case "WorkspaceConnectionsClient.ListSecrets": + resp, err = w.dispatchListSecrets(req) + case "WorkspaceConnectionsClient.BeginTestConnection": + resp, err = w.dispatchBeginTestConnection(req) + case "WorkspaceConnectionsClient.Update": + resp, err = w.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { + if w.srv.Create == nil { + return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.WorkspaceConnectionPropertiesV2BasicResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + connectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionName")]) + if err != nil { + return nil, err + } + var options *armmachinelearning.WorkspaceConnectionsClientCreateOptions + if !reflect.ValueOf(body).IsZero() { + options = &armmachinelearning.WorkspaceConnectionsClientCreateOptions{ + Body: &body, + } + } + respr, errRespr := w.srv.Create(req.Context(), resourceGroupNameParam, workspaceNameParam, connectionNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).WorkspaceConnectionPropertiesV2BasicResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if w.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + connectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.Delete(req.Context(), resourceGroupNameParam, workspaceNameParam, connectionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if w.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + connectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionName")]) + if err != nil { + return nil, err + } + aoaiModelsToDeployUnescaped, err := url.QueryUnescape(qp.Get("aoaiModelsToDeploy")) + if err != nil { + return nil, err + } + aoaiModelsToDeployParam := getOptional(aoaiModelsToDeployUnescaped) + var options *armmachinelearning.WorkspaceConnectionsClientGetOptions + if aoaiModelsToDeployParam != nil { + options = &armmachinelearning.WorkspaceConnectionsClientGetOptions{ + AoaiModelsToDeploy: aoaiModelsToDeployParam, + } + } + respr, errRespr := w.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, connectionNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).WorkspaceConnectionPropertiesV2BasicResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if w.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := w.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + targetUnescaped, err := url.QueryUnescape(qp.Get("target")) + if err != nil { + return nil, err + } + targetParam := getOptional(targetUnescaped) + categoryUnescaped, err := url.QueryUnescape(qp.Get("category")) + if err != nil { + return nil, err + } + categoryParam := getOptional(categoryUnescaped) + var options *armmachinelearning.WorkspaceConnectionsClientListOptions + if targetParam != nil || categoryParam != nil { + options = &armmachinelearning.WorkspaceConnectionsClientListOptions{ + Target: targetParam, + Category: categoryParam, + } + } + resp := w.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + w.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.WorkspaceConnectionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + w.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + w.newListPager.remove(req) + } + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchListSecrets(req *http.Request) (*http.Response, error) { + if w.srv.ListSecrets == nil { + return nil, &nonRetriableError{errors.New("fake for method ListSecrets not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listsecrets` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + connectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionName")]) + if err != nil { + return nil, err + } + aoaiModelsToDeployUnescaped, err := url.QueryUnescape(qp.Get("aoaiModelsToDeploy")) + if err != nil { + return nil, err + } + aoaiModelsToDeployParam := getOptional(aoaiModelsToDeployUnescaped) + var options *armmachinelearning.WorkspaceConnectionsClientListSecretsOptions + if aoaiModelsToDeployParam != nil { + options = &armmachinelearning.WorkspaceConnectionsClientListSecretsOptions{ + AoaiModelsToDeploy: aoaiModelsToDeployParam, + } + } + respr, errRespr := w.srv.ListSecrets(req.Context(), resourceGroupNameParam, workspaceNameParam, connectionNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).WorkspaceConnectionPropertiesV2BasicResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchBeginTestConnection(req *http.Request) (*http.Response, error) { + if w.srv.BeginTestConnection == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginTestConnection not implemented")} + } + beginTestConnection := w.beginTestConnection.get(req) + if beginTestConnection == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testconnection` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.WorkspaceConnectionPropertiesV2BasicResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + connectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionName")]) + if err != nil { + return nil, err + } + var options *armmachinelearning.WorkspaceConnectionsClientBeginTestConnectionOptions + if !reflect.ValueOf(body).IsZero() { + options = &armmachinelearning.WorkspaceConnectionsClientBeginTestConnectionOptions{ + Body: &body, + } + } + respr, errRespr := w.srv.BeginTestConnection(req.Context(), resourceGroupNameParam, workspaceNameParam, connectionNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginTestConnection = &respr + w.beginTestConnection.add(req, beginTestConnection) + } + + resp, err := server.PollerResponderNext(beginTestConnection, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + w.beginTestConnection.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginTestConnection) { + w.beginTestConnection.remove(req) + } + + return resp, nil +} + +func (w *WorkspaceConnectionsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if w.srv.Update == nil { + return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.WorkspaceConnectionUpdateParameter](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + connectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionName")]) + if err != nil { + return nil, err + } + var options *armmachinelearning.WorkspaceConnectionsClientUpdateOptions + if !reflect.ValueOf(body).IsZero() { + options = &armmachinelearning.WorkspaceConnectionsClientUpdateOptions{ + Body: &body, + } + } + respr, errRespr := w.srv.Update(req.Context(), resourceGroupNameParam, workspaceNameParam, connectionNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).WorkspaceConnectionPropertiesV2BasicResource, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspacefeatures_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspacefeatures_server.go new file mode 100644 index 000000000000..4d56bffe84c0 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspacefeatures_server.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "regexp" +) + +// WorkspaceFeaturesServer is a fake server for instances of the armmachinelearning.WorkspaceFeaturesClient type. +type WorkspaceFeaturesServer struct { + // NewListPager is the fake for method WorkspaceFeaturesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspaceFeaturesClientListOptions) (resp azfake.PagerResponder[armmachinelearning.WorkspaceFeaturesClientListResponse]) +} + +// NewWorkspaceFeaturesServerTransport creates a new instance of WorkspaceFeaturesServerTransport with the provided implementation. +// The returned WorkspaceFeaturesServerTransport instance is connected to an instance of armmachinelearning.WorkspaceFeaturesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewWorkspaceFeaturesServerTransport(srv *WorkspaceFeaturesServer) *WorkspaceFeaturesServerTransport { + return &WorkspaceFeaturesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.WorkspaceFeaturesClientListResponse]](), + } +} + +// WorkspaceFeaturesServerTransport connects instances of armmachinelearning.WorkspaceFeaturesClient to instances of WorkspaceFeaturesServer. +// Don't use this type directly, use NewWorkspaceFeaturesServerTransport instead. +type WorkspaceFeaturesServerTransport struct { + srv *WorkspaceFeaturesServer + newListPager *tracker[azfake.PagerResponder[armmachinelearning.WorkspaceFeaturesClientListResponse]] +} + +// Do implements the policy.Transporter interface for WorkspaceFeaturesServerTransport. +func (w *WorkspaceFeaturesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "WorkspaceFeaturesClient.NewListPager": + resp, err = w.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (w *WorkspaceFeaturesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if w.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := w.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/features` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + resp := w.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nil) + newListPager = &resp + w.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.WorkspaceFeaturesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + w.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + w.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go new file mode 100644 index 000000000000..f64a3c9385bd --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go @@ -0,0 +1,767 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" + "net/http" + "net/url" + "reflect" + "regexp" + "strconv" +) + +// WorkspacesServer is a fake server for instances of the armmachinelearning.WorkspacesClient type. +type WorkspacesServer struct { + // BeginCreateOrUpdate is the fake for method WorkspacesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, body armmachinelearning.Workspace, options *armmachinelearning.WorkspacesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspacesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method WorkspacesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspacesClientDeleteResponse], errResp azfake.ErrorResponder) + + // BeginDiagnose is the fake for method WorkspacesClient.BeginDiagnose + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginDiagnose func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientBeginDiagnoseOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspacesClientDiagnoseResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method WorkspacesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientGetOptions) (resp azfake.Responder[armmachinelearning.WorkspacesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method WorkspacesClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armmachinelearning.WorkspacesClientListByResourceGroupOptions) (resp azfake.PagerResponder[armmachinelearning.WorkspacesClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method WorkspacesClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armmachinelearning.WorkspacesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armmachinelearning.WorkspacesClientListBySubscriptionResponse]) + + // ListKeys is the fake for method WorkspacesClient.ListKeys + // HTTP status codes to indicate success: http.StatusOK + ListKeys func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientListKeysOptions) (resp azfake.Responder[armmachinelearning.WorkspacesClientListKeysResponse], errResp azfake.ErrorResponder) + + // ListNotebookAccessToken is the fake for method WorkspacesClient.ListNotebookAccessToken + // HTTP status codes to indicate success: http.StatusOK + ListNotebookAccessToken func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientListNotebookAccessTokenOptions) (resp azfake.Responder[armmachinelearning.WorkspacesClientListNotebookAccessTokenResponse], errResp azfake.ErrorResponder) + + // ListNotebookKeys is the fake for method WorkspacesClient.ListNotebookKeys + // HTTP status codes to indicate success: http.StatusOK + ListNotebookKeys func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientListNotebookKeysOptions) (resp azfake.Responder[armmachinelearning.WorkspacesClientListNotebookKeysResponse], errResp azfake.ErrorResponder) + + // ListOutboundNetworkDependenciesEndpoints is the fake for method WorkspacesClient.ListOutboundNetworkDependenciesEndpoints + // HTTP status codes to indicate success: http.StatusOK + ListOutboundNetworkDependenciesEndpoints func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions) (resp azfake.Responder[armmachinelearning.WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse], errResp azfake.ErrorResponder) + + // ListStorageAccountKeys is the fake for method WorkspacesClient.ListStorageAccountKeys + // HTTP status codes to indicate success: http.StatusOK + ListStorageAccountKeys func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientListStorageAccountKeysOptions) (resp azfake.Responder[armmachinelearning.WorkspacesClientListStorageAccountKeysResponse], errResp azfake.ErrorResponder) + + // BeginPrepareNotebook is the fake for method WorkspacesClient.BeginPrepareNotebook + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginPrepareNotebook func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientBeginPrepareNotebookOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspacesClientPrepareNotebookResponse], errResp azfake.ErrorResponder) + + // BeginResyncKeys is the fake for method WorkspacesClient.BeginResyncKeys + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginResyncKeys func(ctx context.Context, resourceGroupName string, workspaceName string, options *armmachinelearning.WorkspacesClientBeginResyncKeysOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspacesClientResyncKeysResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method WorkspacesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, body armmachinelearning.WorkspaceUpdateParameters, options *armmachinelearning.WorkspacesClientBeginUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.WorkspacesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewWorkspacesServerTransport creates a new instance of WorkspacesServerTransport with the provided implementation. +// The returned WorkspacesServerTransport instance is connected to an instance of armmachinelearning.WorkspacesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewWorkspacesServerTransport(srv *WorkspacesServer) *WorkspacesServerTransport { + return &WorkspacesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientDeleteResponse]](), + beginDiagnose: newTracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientDiagnoseResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armmachinelearning.WorkspacesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armmachinelearning.WorkspacesClientListBySubscriptionResponse]](), + beginPrepareNotebook: newTracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientPrepareNotebookResponse]](), + beginResyncKeys: newTracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientResyncKeysResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientUpdateResponse]](), + } +} + +// WorkspacesServerTransport connects instances of armmachinelearning.WorkspacesClient to instances of WorkspacesServer. +// Don't use this type directly, use NewWorkspacesServerTransport instead. +type WorkspacesServerTransport struct { + srv *WorkspacesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientDeleteResponse]] + beginDiagnose *tracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientDiagnoseResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armmachinelearning.WorkspacesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armmachinelearning.WorkspacesClientListBySubscriptionResponse]] + beginPrepareNotebook *tracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientPrepareNotebookResponse]] + beginResyncKeys *tracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientResyncKeysResponse]] + beginUpdate *tracker[azfake.PollerResponder[armmachinelearning.WorkspacesClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for WorkspacesServerTransport. +func (w *WorkspacesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "WorkspacesClient.BeginCreateOrUpdate": + resp, err = w.dispatchBeginCreateOrUpdate(req) + case "WorkspacesClient.BeginDelete": + resp, err = w.dispatchBeginDelete(req) + case "WorkspacesClient.BeginDiagnose": + resp, err = w.dispatchBeginDiagnose(req) + case "WorkspacesClient.Get": + resp, err = w.dispatchGet(req) + case "WorkspacesClient.NewListByResourceGroupPager": + resp, err = w.dispatchNewListByResourceGroupPager(req) + case "WorkspacesClient.NewListBySubscriptionPager": + resp, err = w.dispatchNewListBySubscriptionPager(req) + case "WorkspacesClient.ListKeys": + resp, err = w.dispatchListKeys(req) + case "WorkspacesClient.ListNotebookAccessToken": + resp, err = w.dispatchListNotebookAccessToken(req) + case "WorkspacesClient.ListNotebookKeys": + resp, err = w.dispatchListNotebookKeys(req) + case "WorkspacesClient.ListOutboundNetworkDependenciesEndpoints": + resp, err = w.dispatchListOutboundNetworkDependenciesEndpoints(req) + case "WorkspacesClient.ListStorageAccountKeys": + resp, err = w.dispatchListStorageAccountKeys(req) + case "WorkspacesClient.BeginPrepareNotebook": + resp, err = w.dispatchBeginPrepareNotebook(req) + case "WorkspacesClient.BeginResyncKeys": + resp, err = w.dispatchBeginResyncKeys(req) + case "WorkspacesClient.BeginUpdate": + resp, err = w.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if w.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := w.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.Workspace](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + w.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + w.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + w.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if w.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := w.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + forceToPurgeUnescaped, err := url.QueryUnescape(qp.Get("forceToPurge")) + if err != nil { + return nil, err + } + forceToPurgeParam, err := parseOptional(forceToPurgeUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + var options *armmachinelearning.WorkspacesClientBeginDeleteOptions + if forceToPurgeParam != nil { + options = &armmachinelearning.WorkspacesClientBeginDeleteOptions{ + ForceToPurge: forceToPurgeParam, + } + } + respr, errRespr := w.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + w.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + w.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + w.beginDelete.remove(req) + } + + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginDiagnose(req *http.Request) (*http.Response, error) { + if w.srv.BeginDiagnose == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDiagnose not implemented")} + } + beginDiagnose := w.beginDiagnose.get(req) + if beginDiagnose == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/diagnose` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.DiagnoseWorkspaceParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + var options *armmachinelearning.WorkspacesClientBeginDiagnoseOptions + if !reflect.ValueOf(body).IsZero() { + options = &armmachinelearning.WorkspacesClientBeginDiagnoseOptions{ + Body: &body, + } + } + respr, errRespr := w.srv.BeginDiagnose(req.Context(), resourceGroupNameParam, workspaceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDiagnose = &respr + w.beginDiagnose.add(req, beginDiagnose) + } + + resp, err := server.PollerResponderNext(beginDiagnose, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + w.beginDiagnose.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDiagnose) { + w.beginDiagnose.remove(req) + } + + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if w.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.Get(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Workspace, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if w.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := w.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + kindUnescaped, err := url.QueryUnescape(qp.Get("kind")) + if err != nil { + return nil, err + } + kindParam := getOptional(kindUnescaped) + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.WorkspacesClientListByResourceGroupOptions + if kindParam != nil || skipParam != nil { + options = &armmachinelearning.WorkspacesClientListByResourceGroupOptions{ + Kind: kindParam, + Skip: skipParam, + } + } + resp := w.srv.NewListByResourceGroupPager(resourceGroupNameParam, options) + newListByResourceGroupPager = &resp + w.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armmachinelearning.WorkspacesClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + w.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + w.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if w.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := w.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + kindUnescaped, err := url.QueryUnescape(qp.Get("kind")) + if err != nil { + return nil, err + } + kindParam := getOptional(kindUnescaped) + skipUnescaped, err := url.QueryUnescape(qp.Get("$skip")) + if err != nil { + return nil, err + } + skipParam := getOptional(skipUnescaped) + var options *armmachinelearning.WorkspacesClientListBySubscriptionOptions + if kindParam != nil || skipParam != nil { + options = &armmachinelearning.WorkspacesClientListBySubscriptionOptions{ + Kind: kindParam, + Skip: skipParam, + } + } + resp := w.srv.NewListBySubscriptionPager(options) + newListBySubscriptionPager = &resp + w.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armmachinelearning.WorkspacesClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + w.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + w.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchListKeys(req *http.Request) (*http.Response, error) { + if w.srv.ListKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.ListKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ListWorkspaceKeysResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchListNotebookAccessToken(req *http.Request) (*http.Response, error) { + if w.srv.ListNotebookAccessToken == nil { + return nil, &nonRetriableError{errors.New("fake for method ListNotebookAccessToken not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listNotebookAccessToken` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.ListNotebookAccessToken(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NotebookAccessTokenResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchListNotebookKeys(req *http.Request) (*http.Response, error) { + if w.srv.ListNotebookKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListNotebookKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listNotebookKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.ListNotebookKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ListNotebookKeysResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchListOutboundNetworkDependenciesEndpoints(req *http.Request) (*http.Response, error) { + if w.srv.ListOutboundNetworkDependenciesEndpoints == nil { + return nil, &nonRetriableError{errors.New("fake for method ListOutboundNetworkDependenciesEndpoints not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/outboundNetworkDependenciesEndpoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.ListOutboundNetworkDependenciesEndpoints(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExternalFQDNResponse, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchListStorageAccountKeys(req *http.Request) (*http.Response, error) { + if w.srv.ListStorageAccountKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListStorageAccountKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listStorageAccountKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.ListStorageAccountKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ListStorageAccountKeysResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginPrepareNotebook(req *http.Request) (*http.Response, error) { + if w.srv.BeginPrepareNotebook == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginPrepareNotebook not implemented")} + } + beginPrepareNotebook := w.beginPrepareNotebook.get(req) + if beginPrepareNotebook == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/prepareNotebook` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.BeginPrepareNotebook(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginPrepareNotebook = &respr + w.beginPrepareNotebook.add(req, beginPrepareNotebook) + } + + resp, err := server.PollerResponderNext(beginPrepareNotebook, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + w.beginPrepareNotebook.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginPrepareNotebook) { + w.beginPrepareNotebook.remove(req) + } + + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginResyncKeys(req *http.Request) (*http.Response, error) { + if w.srv.BeginResyncKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginResyncKeys not implemented")} + } + beginResyncKeys := w.beginResyncKeys.get(req) + if beginResyncKeys == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resyncKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.BeginResyncKeys(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginResyncKeys = &respr + w.beginResyncKeys.add(req, beginResyncKeys) + } + + resp, err := server.PollerResponderNext(beginResyncKeys, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + w.beginResyncKeys.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginResyncKeys) { + w.beginResyncKeys.remove(req) + } + + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if w.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := w.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.MachineLearningServices/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.WorkspaceUpdateParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.BeginUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + w.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + w.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + w.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/features_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/features_client.go new file mode 100644 index 000000000000..606ea2267662 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/features_client.go @@ -0,0 +1,216 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// FeaturesClient contains the methods for the Features group. +// Don't use this type directly, use NewFeaturesClient() instead. +type FeaturesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFeaturesClient creates a new instance of FeaturesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFeaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FeaturesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FeaturesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get feature. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - featuresetName - Feature set name. This is case-sensitive. +// - featuresetVersion - Feature set version identifier. This is case-sensitive. +// - featureName - Feature Name. This is case-sensitive. +// - options - FeaturesClientGetOptions contains the optional parameters for the FeaturesClient.Get method. +func (client *FeaturesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, featuresetName string, featuresetVersion string, featureName string, options *FeaturesClientGetOptions) (FeaturesClientGetResponse, error) { + var err error + const operationName = "FeaturesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, featuresetName, featuresetVersion, featureName, options) + if err != nil { + return FeaturesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FeaturesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FeaturesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *FeaturesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, featuresetName string, featuresetVersion string, featureName string, options *FeaturesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features/{featureName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if featuresetName == "" { + return nil, errors.New("parameter featuresetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{featuresetName}", url.PathEscape(featuresetName)) + if featuresetVersion == "" { + return nil, errors.New("parameter featuresetVersion cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{featuresetVersion}", url.PathEscape(featuresetVersion)) + if featureName == "" { + return nil, errors.New("parameter featureName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{featureName}", url.PathEscape(featureName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FeaturesClient) getHandleResponse(resp *http.Response) (FeaturesClientGetResponse, error) { + result := FeaturesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Feature); err != nil { + return FeaturesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List Features. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - featuresetName - Featureset name. This is case-sensitive. +// - featuresetVersion - Featureset Version identifier. This is case-sensitive. +// - options - FeaturesClientListOptions contains the optional parameters for the FeaturesClient.NewListPager method. +func (client *FeaturesClient) NewListPager(resourceGroupName string, workspaceName string, featuresetName string, featuresetVersion string, options *FeaturesClientListOptions) *runtime.Pager[FeaturesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FeaturesClientListResponse]{ + More: func(page FeaturesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FeaturesClientListResponse) (FeaturesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FeaturesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, featuresetName, featuresetVersion, options) + }, nil) + if err != nil { + return FeaturesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FeaturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, featuresetName string, featuresetVersion string, options *FeaturesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{featuresetName}/versions/{featuresetVersion}/features" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if featuresetName == "" { + return nil, errors.New("parameter featuresetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{featuresetName}", url.PathEscape(featuresetName)) + if featuresetVersion == "" { + return nil, errors.New("parameter featuresetVersion cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{featuresetVersion}", url.PathEscape(featuresetVersion)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.FeatureName != nil { + reqQP.Set("featureName", *options.FeatureName) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FeaturesClient) listHandleResponse(resp *http.Response) (FeaturesClientListResponse, error) { + result := FeaturesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeatureResourceArmPaginatedResult); err != nil { + return FeaturesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/featuresetcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/featuresetcontainers_client.go new file mode 100644 index 000000000000..e0107adc2df8 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/featuresetcontainers_client.go @@ -0,0 +1,369 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// FeaturesetContainersClient contains the methods for the FeaturesetContainers group. +// Don't use this type directly, use NewFeaturesetContainersClient() instead. +type FeaturesetContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFeaturesetContainersClient creates a new instance of FeaturesetContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFeaturesetContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FeaturesetContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FeaturesetContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - body - Container entity to create or update. +// - options - FeaturesetContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturesetContainersClient.BeginCreateOrUpdate +// method. +func (client *FeaturesetContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body FeaturesetContainer, options *FeaturesetContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturesetContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturesetContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturesetContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturesetContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body FeaturesetContainer, options *FeaturesetContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "FeaturesetContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FeaturesetContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body FeaturesetContainer, options *FeaturesetContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - options - FeaturesetContainersClientBeginDeleteOptions contains the optional parameters for the FeaturesetContainersClient.BeginDelete +// method. +func (client *FeaturesetContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturesetContainersClientBeginDeleteOptions) (*runtime.Poller[FeaturesetContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturesetContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturesetContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturesetContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturesetContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "FeaturesetContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FeaturesetContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturesetContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// GetEntity - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - options - FeaturesetContainersClientGetEntityOptions contains the optional parameters for the FeaturesetContainersClient.GetEntity +// method. +func (client *FeaturesetContainersClient) GetEntity(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturesetContainersClientGetEntityOptions) (FeaturesetContainersClientGetEntityResponse, error) { + var err error + const operationName = "FeaturesetContainersClient.GetEntity" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getEntityCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return FeaturesetContainersClientGetEntityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FeaturesetContainersClientGetEntityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FeaturesetContainersClientGetEntityResponse{}, err + } + resp, err := client.getEntityHandleResponse(httpResp) + return resp, err +} + +// getEntityCreateRequest creates the GetEntity request. +func (client *FeaturesetContainersClient) getEntityCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturesetContainersClientGetEntityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityHandleResponse handles the GetEntity response. +func (client *FeaturesetContainersClient) getEntityHandleResponse(resp *http.Response) (FeaturesetContainersClientGetEntityResponse, error) { + result := FeaturesetContainersClientGetEntityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturesetContainer); err != nil { + return FeaturesetContainersClientGetEntityResponse{}, err + } + return result, nil +} + +// NewListPager - List featurestore entity containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - options - FeaturesetContainersClientListOptions contains the optional parameters for the FeaturesetContainersClient.NewListPager +// method. +func (client *FeaturesetContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *FeaturesetContainersClientListOptions) *runtime.Pager[FeaturesetContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FeaturesetContainersClientListResponse]{ + More: func(page FeaturesetContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FeaturesetContainersClientListResponse) (FeaturesetContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FeaturesetContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return FeaturesetContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FeaturesetContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *FeaturesetContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.Name != nil { + reqQP.Set("name", *options.Name) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FeaturesetContainersClient) listHandleResponse(resp *http.Response) (FeaturesetContainersClientListResponse, error) { + result := FeaturesetContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturesetContainerResourceArmPaginatedResult); err != nil { + return FeaturesetContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/featuresetversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/featuresetversions_client.go new file mode 100644 index 000000000000..4214eb790e47 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/featuresetversions_client.go @@ -0,0 +1,485 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// FeaturesetVersionsClient contains the methods for the FeaturesetVersions group. +// Don't use this type directly, use NewFeaturesetVersionsClient() instead. +type FeaturesetVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFeaturesetVersionsClient creates a new instance of FeaturesetVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFeaturesetVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FeaturesetVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FeaturesetVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginBackfill - Backfill. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Feature set version backfill request entity. +// - options - FeaturesetVersionsClientBeginBackfillOptions contains the optional parameters for the FeaturesetVersionsClient.BeginBackfill +// method. +func (client *FeaturesetVersionsClient) BeginBackfill(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturesetVersionBackfillRequest, options *FeaturesetVersionsClientBeginBackfillOptions) (*runtime.Poller[FeaturesetVersionsClientBackfillResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.backfill(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturesetVersionsClientBackfillResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturesetVersionsClientBackfillResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Backfill - Backfill. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturesetVersionsClient) backfill(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturesetVersionBackfillRequest, options *FeaturesetVersionsClientBeginBackfillOptions) (*http.Response, error) { + var err error + const operationName = "FeaturesetVersionsClient.BeginBackfill" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.backfillCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// backfillCreateRequest creates the Backfill request. +func (client *FeaturesetVersionsClient) backfillCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturesetVersionBackfillRequest, options *FeaturesetVersionsClientBeginBackfillOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}/backfill" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Version entity to create or update. +// - options - FeaturesetVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturesetVersionsClient.BeginCreateOrUpdate +// method. +func (client *FeaturesetVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturesetVersion, options *FeaturesetVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturesetVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturesetVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturesetVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturesetVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturesetVersion, options *FeaturesetVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "FeaturesetVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FeaturesetVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturesetVersion, options *FeaturesetVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - options - FeaturesetVersionsClientBeginDeleteOptions contains the optional parameters for the FeaturesetVersionsClient.BeginDelete +// method. +func (client *FeaturesetVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturesetVersionsClientBeginDeleteOptions) (*runtime.Poller[FeaturesetVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturesetVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturesetVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturesetVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturesetVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "FeaturesetVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FeaturesetVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturesetVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - options - FeaturesetVersionsClientGetOptions contains the optional parameters for the FeaturesetVersionsClient.Get method. +func (client *FeaturesetVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturesetVersionsClientGetOptions) (FeaturesetVersionsClientGetResponse, error) { + var err error + const operationName = "FeaturesetVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return FeaturesetVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FeaturesetVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FeaturesetVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *FeaturesetVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturesetVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FeaturesetVersionsClient) getHandleResponse(resp *http.Response) (FeaturesetVersionsClientGetResponse, error) { + result := FeaturesetVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturesetVersion); err != nil { + return FeaturesetVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Featureset name. This is case-sensitive. +// - options - FeaturesetVersionsClientListOptions contains the optional parameters for the FeaturesetVersionsClient.NewListPager +// method. +func (client *FeaturesetVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *FeaturesetVersionsClientListOptions) *runtime.Pager[FeaturesetVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FeaturesetVersionsClientListResponse]{ + More: func(page FeaturesetVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FeaturesetVersionsClientListResponse) (FeaturesetVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FeaturesetVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) + if err != nil { + return FeaturesetVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FeaturesetVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturesetVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.VersionName != nil { + reqQP.Set("versionName", *options.VersionName) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FeaturesetVersionsClient) listHandleResponse(resp *http.Response) (FeaturesetVersionsClientListResponse, error) { + result := FeaturesetVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturesetVersionResourceArmPaginatedResult); err != nil { + return FeaturesetVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentitycontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentitycontainers_client.go new file mode 100644 index 000000000000..40afc3ad98c8 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentitycontainers_client.go @@ -0,0 +1,369 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// FeaturestoreEntityContainersClient contains the methods for the FeaturestoreEntityContainers group. +// Don't use this type directly, use NewFeaturestoreEntityContainersClient() instead. +type FeaturestoreEntityContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFeaturestoreEntityContainersClient creates a new instance of FeaturestoreEntityContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFeaturestoreEntityContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FeaturestoreEntityContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FeaturestoreEntityContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - body - Container entity to create or update. +// - options - FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturestoreEntityContainersClient.BeginCreateOrUpdate +// method. +func (client *FeaturestoreEntityContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body FeaturestoreEntityContainer, options *FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturestoreEntityContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturestoreEntityContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturestoreEntityContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturestoreEntityContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body FeaturestoreEntityContainer, options *FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "FeaturestoreEntityContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FeaturestoreEntityContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body FeaturestoreEntityContainer, options *FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - options - FeaturestoreEntityContainersClientBeginDeleteOptions contains the optional parameters for the FeaturestoreEntityContainersClient.BeginDelete +// method. +func (client *FeaturestoreEntityContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityContainersClientBeginDeleteOptions) (*runtime.Poller[FeaturestoreEntityContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturestoreEntityContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturestoreEntityContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturestoreEntityContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "FeaturestoreEntityContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FeaturestoreEntityContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// GetEntity - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - options - FeaturestoreEntityContainersClientGetEntityOptions contains the optional parameters for the FeaturestoreEntityContainersClient.GetEntity +// method. +func (client *FeaturestoreEntityContainersClient) GetEntity(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityContainersClientGetEntityOptions) (FeaturestoreEntityContainersClientGetEntityResponse, error) { + var err error + const operationName = "FeaturestoreEntityContainersClient.GetEntity" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getEntityCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return FeaturestoreEntityContainersClientGetEntityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FeaturestoreEntityContainersClientGetEntityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FeaturestoreEntityContainersClientGetEntityResponse{}, err + } + resp, err := client.getEntityHandleResponse(httpResp) + return resp, err +} + +// getEntityCreateRequest creates the GetEntity request. +func (client *FeaturestoreEntityContainersClient) getEntityCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityContainersClientGetEntityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityHandleResponse handles the GetEntity response. +func (client *FeaturestoreEntityContainersClient) getEntityHandleResponse(resp *http.Response) (FeaturestoreEntityContainersClientGetEntityResponse, error) { + result := FeaturestoreEntityContainersClientGetEntityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturestoreEntityContainer); err != nil { + return FeaturestoreEntityContainersClientGetEntityResponse{}, err + } + return result, nil +} + +// NewListPager - List featurestore entity containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - options - FeaturestoreEntityContainersClientListOptions contains the optional parameters for the FeaturestoreEntityContainersClient.NewListPager +// method. +func (client *FeaturestoreEntityContainersClient) NewListPager(resourceGroupName string, workspaceName string, options *FeaturestoreEntityContainersClientListOptions) *runtime.Pager[FeaturestoreEntityContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FeaturestoreEntityContainersClientListResponse]{ + More: func(page FeaturestoreEntityContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FeaturestoreEntityContainersClientListResponse) (FeaturestoreEntityContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FeaturestoreEntityContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return FeaturestoreEntityContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FeaturestoreEntityContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *FeaturestoreEntityContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.Name != nil { + reqQP.Set("name", *options.Name) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FeaturestoreEntityContainersClient) listHandleResponse(resp *http.Response) (FeaturestoreEntityContainersClientListResponse, error) { + result := FeaturestoreEntityContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturestoreEntityContainerResourceArmPaginatedResult); err != nil { + return FeaturestoreEntityContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentityversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentityversions_client.go new file mode 100644 index 000000000000..d376c051398d --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/featurestoreentityversions_client.go @@ -0,0 +1,395 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// FeaturestoreEntityVersionsClient contains the methods for the FeaturestoreEntityVersions group. +// Don't use this type directly, use NewFeaturestoreEntityVersionsClient() instead. +type FeaturestoreEntityVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFeaturestoreEntityVersionsClient creates a new instance of FeaturestoreEntityVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFeaturestoreEntityVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FeaturestoreEntityVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FeaturestoreEntityVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Version entity to create or update. +// - options - FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.BeginCreateOrUpdate +// method. +func (client *FeaturestoreEntityVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturestoreEntityVersion, options *FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FeaturestoreEntityVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturestoreEntityVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturestoreEntityVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturestoreEntityVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturestoreEntityVersion, options *FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "FeaturestoreEntityVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *FeaturestoreEntityVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body FeaturestoreEntityVersion, options *FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - options - FeaturestoreEntityVersionsClientBeginDeleteOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.BeginDelete +// method. +func (client *FeaturestoreEntityVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturestoreEntityVersionsClientBeginDeleteOptions) (*runtime.Poller[FeaturestoreEntityVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FeaturestoreEntityVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FeaturestoreEntityVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *FeaturestoreEntityVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturestoreEntityVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "FeaturestoreEntityVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *FeaturestoreEntityVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturestoreEntityVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - options - FeaturestoreEntityVersionsClientGetOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.Get +// method. +func (client *FeaturestoreEntityVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturestoreEntityVersionsClientGetOptions) (FeaturestoreEntityVersionsClientGetResponse, error) { + var err error + const operationName = "FeaturestoreEntityVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) + if err != nil { + return FeaturestoreEntityVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FeaturestoreEntityVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FeaturestoreEntityVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *FeaturestoreEntityVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *FeaturestoreEntityVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FeaturestoreEntityVersionsClient) getHandleResponse(resp *http.Response) (FeaturestoreEntityVersionsClientGetResponse, error) { + result := FeaturestoreEntityVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturestoreEntityVersion); err != nil { + return FeaturestoreEntityVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Feature entity name. This is case-sensitive. +// - options - FeaturestoreEntityVersionsClientListOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.NewListPager +// method. +func (client *FeaturestoreEntityVersionsClient) NewListPager(resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityVersionsClientListOptions) *runtime.Pager[FeaturestoreEntityVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FeaturestoreEntityVersionsClientListResponse]{ + More: func(page FeaturestoreEntityVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FeaturestoreEntityVersionsClientListResponse) (FeaturestoreEntityVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FeaturestoreEntityVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) + if err != nil { + return FeaturestoreEntityVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FeaturestoreEntityVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *FeaturestoreEntityVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.VersionName != nil { + reqQP.Set("versionName", *options.VersionName) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FeaturestoreEntityVersionsClient) listHandleResponse(resp *http.Response) (FeaturestoreEntityVersionsClientListResponse, error) { + result := FeaturestoreEntityVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FeaturestoreEntityVersionResourceArmPaginatedResult); err != nil { + return FeaturestoreEntityVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod b/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod index 5503d012775a..f02adf6860c7 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/text v0.13.0 // indirect ) diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum b/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum index 8ba445a8c4da..428cd71de305 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum @@ -1,31 +1,12 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/inferenceendpoints_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/inferenceendpoints_client.go new file mode 100644 index 000000000000..76ca8e4b869a --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/inferenceendpoints_client.go @@ -0,0 +1,472 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// InferenceEndpointsClient contains the methods for the InferenceEndpoints group. +// Don't use this type directly, use NewInferenceEndpointsClient() instead. +type InferenceEndpointsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInferenceEndpointsClient creates a new instance of InferenceEndpointsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInferenceEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InferenceEndpointsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InferenceEndpointsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update InferenceEndpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - endpointName - InferenceEndpoint name. +// - body - InferenceEndpoint entity to apply during operation. +// - options - InferenceEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the InferenceEndpointsClient.BeginCreateOrUpdate +// method. +func (client *InferenceEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body InferenceEndpoint, options *InferenceEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InferenceEndpointsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, poolName, endpointName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferenceEndpointsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferenceEndpointsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update InferenceEndpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferenceEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body InferenceEndpoint, options *InferenceEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "InferenceEndpointsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, poolName, endpointName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InferenceEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body InferenceEndpoint, options *InferenceEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete InferenceEndpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - endpointName - InferenceEndpoint name. +// - options - InferenceEndpointsClientBeginDeleteOptions contains the optional parameters for the InferenceEndpointsClient.BeginDelete +// method. +func (client *InferenceEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *InferenceEndpointsClientBeginDeleteOptions) (*runtime.Poller[InferenceEndpointsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, poolName, endpointName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferenceEndpointsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferenceEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete InferenceEndpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferenceEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *InferenceEndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "InferenceEndpointsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, poolName, endpointName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InferenceEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *InferenceEndpointsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get InferenceEndpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - endpointName - InferenceEndpoint name. +// - options - InferenceEndpointsClientGetOptions contains the optional parameters for the InferenceEndpointsClient.Get method. +func (client *InferenceEndpointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *InferenceEndpointsClientGetOptions) (InferenceEndpointsClientGetResponse, error) { + var err error + const operationName = "InferenceEndpointsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, poolName, endpointName, options) + if err != nil { + return InferenceEndpointsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InferenceEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InferenceEndpointsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *InferenceEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, options *InferenceEndpointsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InferenceEndpointsClient) getHandleResponse(resp *http.Response) (InferenceEndpointsClientGetResponse, error) { + result := InferenceEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InferenceEndpoint); err != nil { + return InferenceEndpointsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List Inference Endpoints. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - Name of the InferencePool. +// - options - InferenceEndpointsClientListOptions contains the optional parameters for the InferenceEndpointsClient.NewListPager +// method. +func (client *InferenceEndpointsClient) NewListPager(resourceGroupName string, workspaceName string, poolName string, options *InferenceEndpointsClientListOptions) *runtime.Pager[InferenceEndpointsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InferenceEndpointsClientListResponse]{ + More: func(page InferenceEndpointsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InferenceEndpointsClientListResponse) (InferenceEndpointsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InferenceEndpointsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, poolName, options) + }, nil) + if err != nil { + return InferenceEndpointsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *InferenceEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, options *InferenceEndpointsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("orderBy", string(*options.OrderBy)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InferenceEndpointsClient) listHandleResponse(resp *http.Response) (InferenceEndpointsClientListResponse, error) { + result := InferenceEndpointsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InferenceEndpointTrackedResourceArmPaginatedResult); err != nil { + return InferenceEndpointsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update InferenceEndpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - endpointName - InferenceEndpoint name. +// - body - Online Endpoint entity to apply during operation. +// - options - InferenceEndpointsClientBeginUpdateOptions contains the optional parameters for the InferenceEndpointsClient.BeginUpdate +// method. +func (client *InferenceEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body any, options *InferenceEndpointsClientBeginUpdateOptions) (*runtime.Poller[InferenceEndpointsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, poolName, endpointName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferenceEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferenceEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update InferenceEndpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferenceEndpointsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body any, options *InferenceEndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "InferenceEndpointsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, poolName, endpointName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *InferenceEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, endpointName string, body any, options *InferenceEndpointsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/endpoints/{endpointName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if endpointName == "" { + return nil, errors.New("parameter endpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{endpointName}", url.PathEscape(endpointName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/inferencegroups_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/inferencegroups_client.go new file mode 100644 index 000000000000..694d95559e8f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/inferencegroups_client.go @@ -0,0 +1,628 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// InferenceGroupsClient contains the methods for the InferenceGroups group. +// Don't use this type directly, use NewInferenceGroupsClient() instead. +type InferenceGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInferenceGroupsClient creates a new instance of InferenceGroupsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInferenceGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InferenceGroupsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InferenceGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update InferenceGroup (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - groupName - InferenceGroup name. +// - body - InferenceGroup entity to apply during operation. +// - options - InferenceGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InferenceGroupsClient.BeginCreateOrUpdate +// method. +func (client *InferenceGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body InferenceGroup, options *InferenceGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InferenceGroupsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, poolName, groupName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferenceGroupsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferenceGroupsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update InferenceGroup (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferenceGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body InferenceGroup, options *InferenceGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "InferenceGroupsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, poolName, groupName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InferenceGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body InferenceGroup, options *InferenceGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete InferenceGroup (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - groupName - InferenceGroup name. +// - options - InferenceGroupsClientBeginDeleteOptions contains the optional parameters for the InferenceGroupsClient.BeginDelete +// method. +func (client *InferenceGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientBeginDeleteOptions) (*runtime.Poller[InferenceGroupsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, poolName, groupName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferenceGroupsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferenceGroupsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete InferenceGroup (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferenceGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "InferenceGroupsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, poolName, groupName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InferenceGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get InferenceGroup. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - groupName - InferenceGroup name. +// - options - InferenceGroupsClientGetOptions contains the optional parameters for the InferenceGroupsClient.Get method. +func (client *InferenceGroupsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientGetOptions) (InferenceGroupsClientGetResponse, error) { + var err error + const operationName = "InferenceGroupsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, poolName, groupName, options) + if err != nil { + return InferenceGroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InferenceGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InferenceGroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *InferenceGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InferenceGroupsClient) getHandleResponse(resp *http.Response) (InferenceGroupsClientGetResponse, error) { + result := InferenceGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InferenceGroup); err != nil { + return InferenceGroupsClientGetResponse{}, err + } + return result, nil +} + +// GetStatus - Retrieve inference group status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - groupName - InferenceGroup name. +// - options - InferenceGroupsClientGetStatusOptions contains the optional parameters for the InferenceGroupsClient.GetStatus +// method. +func (client *InferenceGroupsClient) GetStatus(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientGetStatusOptions) (InferenceGroupsClientGetStatusResponse, error) { + var err error + const operationName = "InferenceGroupsClient.GetStatus" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getStatusCreateRequest(ctx, resourceGroupName, workspaceName, poolName, groupName, options) + if err != nil { + return InferenceGroupsClientGetStatusResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InferenceGroupsClientGetStatusResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InferenceGroupsClientGetStatusResponse{}, err + } + resp, err := client.getStatusHandleResponse(httpResp) + return resp, err +} + +// getStatusCreateRequest creates the GetStatus request. +func (client *InferenceGroupsClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientGetStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/getStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getStatusHandleResponse handles the GetStatus response. +func (client *InferenceGroupsClient) getStatusHandleResponse(resp *http.Response) (InferenceGroupsClientGetStatusResponse, error) { + result := InferenceGroupsClientGetStatusResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GroupStatus); err != nil { + return InferenceGroupsClientGetStatusResponse{}, err + } + return result, nil +} + +// NewListPager - List Inference Groups. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - Name of the InferencePool. +// - options - InferenceGroupsClientListOptions contains the optional parameters for the InferenceGroupsClient.NewListPager +// method. +func (client *InferenceGroupsClient) NewListPager(resourceGroupName string, workspaceName string, poolName string, options *InferenceGroupsClientListOptions) *runtime.Pager[InferenceGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InferenceGroupsClientListResponse]{ + More: func(page InferenceGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InferenceGroupsClientListResponse) (InferenceGroupsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InferenceGroupsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, poolName, options) + }, nil) + if err != nil { + return InferenceGroupsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *InferenceGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, options *InferenceGroupsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("orderBy", string(*options.OrderBy)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InferenceGroupsClient) listHandleResponse(resp *http.Response) (InferenceGroupsClientListResponse, error) { + result := InferenceGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InferenceGroupTrackedResourceArmPaginatedResult); err != nil { + return InferenceGroupsClientListResponse{}, err + } + return result, nil +} + +// NewListSKUsPager - List Inference Group Skus. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - Inference Pool name. +// - groupName - Inference Group name. +// - options - InferenceGroupsClientListSKUsOptions contains the optional parameters for the InferenceGroupsClient.NewListSKUsPager +// method. +func (client *InferenceGroupsClient) NewListSKUsPager(resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientListSKUsOptions) *runtime.Pager[InferenceGroupsClientListSKUsResponse] { + return runtime.NewPager(runtime.PagingHandler[InferenceGroupsClientListSKUsResponse]{ + More: func(page InferenceGroupsClientListSKUsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InferenceGroupsClientListSKUsResponse) (InferenceGroupsClientListSKUsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InferenceGroupsClient.NewListSKUsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listSKUsCreateRequest(ctx, resourceGroupName, workspaceName, poolName, groupName, options) + }, nil) + if err != nil { + return InferenceGroupsClientListSKUsResponse{}, err + } + return client.listSKUsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listSKUsCreateRequest creates the ListSKUs request. +func (client *InferenceGroupsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, options *InferenceGroupsClientListSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSKUsHandleResponse handles the ListSKUs response. +func (client *InferenceGroupsClient) listSKUsHandleResponse(resp *http.Response) (InferenceGroupsClientListSKUsResponse, error) { + result := InferenceGroupsClientListSKUsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUResourceArmPaginatedResult); err != nil { + return InferenceGroupsClientListSKUsResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update InferenceGroup (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - poolName - InferencePool name. +// - groupName - InferenceGroup name. +// - body - Online Endpoint entity to apply during operation. +// - options - InferenceGroupsClientBeginUpdateOptions contains the optional parameters for the InferenceGroupsClient.BeginUpdate +// method. +func (client *InferenceGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body PartialMinimalTrackedResourceWithSKU, options *InferenceGroupsClientBeginUpdateOptions) (*runtime.Poller[InferenceGroupsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, poolName, groupName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferenceGroupsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferenceGroupsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update InferenceGroup (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferenceGroupsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body PartialMinimalTrackedResourceWithSKU, options *InferenceGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "InferenceGroupsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, poolName, groupName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *InferenceGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, poolName string, groupName string, body PartialMinimalTrackedResourceWithSKU, options *InferenceGroupsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{poolName}/groups/{groupName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if groupName == "" { + return nil, errors.New("parameter groupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/inferencepools_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/inferencepools_client.go new file mode 100644 index 000000000000..875ec5a5a6e2 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/inferencepools_client.go @@ -0,0 +1,592 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// InferencePoolsClient contains the methods for the InferencePools group. +// Don't use this type directly, use NewInferencePoolsClient() instead. +type InferencePoolsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewInferencePoolsClient creates a new instance of InferencePoolsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewInferencePoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InferencePoolsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &InferencePoolsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update InferencePool (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - inferencePoolName - Name of InferencePool +// - body - InferencePool entity to apply during operation. +// - options - InferencePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InferencePoolsClient.BeginCreateOrUpdate +// method. +func (client *InferencePoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body InferencePool, options *InferencePoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InferencePoolsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, inferencePoolName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferencePoolsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferencePoolsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update InferencePool (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferencePoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body InferencePool, options *InferencePoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "InferencePoolsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, inferencePoolName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *InferencePoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body InferencePool, options *InferencePoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if inferencePoolName == "" { + return nil, errors.New("parameter inferencePoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inferencePoolName}", url.PathEscape(inferencePoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete InferencePool (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - inferencePoolName - Name of InferencePool +// - options - InferencePoolsClientBeginDeleteOptions contains the optional parameters for the InferencePoolsClient.BeginDelete +// method. +func (client *InferencePoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientBeginDeleteOptions) (*runtime.Poller[InferencePoolsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, inferencePoolName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferencePoolsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferencePoolsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete InferencePool (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferencePoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "InferencePoolsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, inferencePoolName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *InferencePoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if inferencePoolName == "" { + return nil, errors.New("parameter inferencePoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inferencePoolName}", url.PathEscape(inferencePoolName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get InferencePool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - inferencePoolName - Name of InferencePool +// - options - InferencePoolsClientGetOptions contains the optional parameters for the InferencePoolsClient.Get method. +func (client *InferencePoolsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientGetOptions) (InferencePoolsClientGetResponse, error) { + var err error + const operationName = "InferencePoolsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, inferencePoolName, options) + if err != nil { + return InferencePoolsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InferencePoolsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InferencePoolsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *InferencePoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if inferencePoolName == "" { + return nil, errors.New("parameter inferencePoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inferencePoolName}", url.PathEscape(inferencePoolName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *InferencePoolsClient) getHandleResponse(resp *http.Response) (InferencePoolsClientGetResponse, error) { + result := InferencePoolsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InferencePool); err != nil { + return InferencePoolsClientGetResponse{}, err + } + return result, nil +} + +// GetStatus - Retrieve inference pool status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - inferencePoolName - Name of InferencePool +// - options - InferencePoolsClientGetStatusOptions contains the optional parameters for the InferencePoolsClient.GetStatus +// method. +func (client *InferencePoolsClient) GetStatus(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientGetStatusOptions) (InferencePoolsClientGetStatusResponse, error) { + var err error + const operationName = "InferencePoolsClient.GetStatus" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getStatusCreateRequest(ctx, resourceGroupName, workspaceName, inferencePoolName, options) + if err != nil { + return InferencePoolsClientGetStatusResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return InferencePoolsClientGetStatusResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InferencePoolsClientGetStatusResponse{}, err + } + resp, err := client.getStatusHandleResponse(httpResp) + return resp, err +} + +// getStatusCreateRequest creates the GetStatus request. +func (client *InferencePoolsClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientGetStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/getStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if inferencePoolName == "" { + return nil, errors.New("parameter inferencePoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inferencePoolName}", url.PathEscape(inferencePoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getStatusHandleResponse handles the GetStatus response. +func (client *InferencePoolsClient) getStatusHandleResponse(resp *http.Response) (InferencePoolsClientGetStatusResponse, error) { + result := InferencePoolsClientGetStatusResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PoolStatus); err != nil { + return InferencePoolsClientGetStatusResponse{}, err + } + return result, nil +} + +// NewListPager - List InferencePools. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - options - InferencePoolsClientListOptions contains the optional parameters for the InferencePoolsClient.NewListPager method. +func (client *InferencePoolsClient) NewListPager(resourceGroupName string, workspaceName string, options *InferencePoolsClientListOptions) *runtime.Pager[InferencePoolsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[InferencePoolsClientListResponse]{ + More: func(page InferencePoolsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InferencePoolsClientListResponse) (InferencePoolsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InferencePoolsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return InferencePoolsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *InferencePoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *InferencePoolsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("orderBy", string(*options.OrderBy)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *InferencePoolsClient) listHandleResponse(resp *http.Response) (InferencePoolsClientListResponse, error) { + result := InferencePoolsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.InferencePoolTrackedResourceArmPaginatedResult); err != nil { + return InferencePoolsClientListResponse{}, err + } + return result, nil +} + +// NewListSKUsPager - List Inference Pool Skus. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - inferencePoolName - Inference Group name. +// - options - InferencePoolsClientListSKUsOptions contains the optional parameters for the InferencePoolsClient.NewListSKUsPager +// method. +func (client *InferencePoolsClient) NewListSKUsPager(resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientListSKUsOptions) *runtime.Pager[InferencePoolsClientListSKUsResponse] { + return runtime.NewPager(runtime.PagingHandler[InferencePoolsClientListSKUsResponse]{ + More: func(page InferencePoolsClientListSKUsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *InferencePoolsClientListSKUsResponse) (InferencePoolsClientListSKUsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "InferencePoolsClient.NewListSKUsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listSKUsCreateRequest(ctx, resourceGroupName, workspaceName, inferencePoolName, options) + }, nil) + if err != nil { + return InferencePoolsClientListSKUsResponse{}, err + } + return client.listSKUsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listSKUsCreateRequest creates the ListSKUs request. +func (client *InferencePoolsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, options *InferencePoolsClientListSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if inferencePoolName == "" { + return nil, errors.New("parameter inferencePoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inferencePoolName}", url.PathEscape(inferencePoolName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSKUsHandleResponse handles the ListSKUs response. +func (client *InferencePoolsClient) listSKUsHandleResponse(resp *http.Response) (InferencePoolsClientListSKUsResponse, error) { + result := InferencePoolsClientListSKUsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUResourceArmPaginatedResult); err != nil { + return InferencePoolsClientListSKUsResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update InferencePool (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - inferencePoolName - Name of InferencePool +// - body - Inference Pool entity to apply during operation. +// - options - InferencePoolsClientBeginUpdateOptions contains the optional parameters for the InferencePoolsClient.BeginUpdate +// method. +func (client *InferencePoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *InferencePoolsClientBeginUpdateOptions) (*runtime.Poller[InferencePoolsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, inferencePoolName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InferencePoolsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[InferencePoolsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update InferencePool (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *InferencePoolsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *InferencePoolsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "InferencePoolsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, inferencePoolName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *InferencePoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, inferencePoolName string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *InferencePoolsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/inferencePools/{inferencePoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if inferencePoolName == "" { + return nil, errors.New("parameter inferencePoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{inferencePoolName}", url.PathEscape(inferencePoolName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go b/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go new file mode 100644 index 000000000000..3264cc70bbb7 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go @@ -0,0 +1,471 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +// AssetReferenceBaseClassification provides polymorphic access to related types. +// Call the interface's GetAssetReferenceBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AssetReferenceBase, *DataPathAssetReference, *IDAssetReference, *OutputPathAssetReference +type AssetReferenceBaseClassification interface { + // GetAssetReferenceBase returns the AssetReferenceBase content of the underlying type. + GetAssetReferenceBase() *AssetReferenceBase +} + +// AutoMLVerticalClassification provides polymorphic access to related types. +// Call the interface's GetAutoMLVertical() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoMLVertical, *Classification, *Forecasting, *ImageClassification, *ImageClassificationMultilabel, *ImageInstanceSegmentation, +// - *ImageObjectDetection, *Regression, *TextClassification, *TextClassificationMultilabel, *TextNer +type AutoMLVerticalClassification interface { + // GetAutoMLVertical returns the AutoMLVertical content of the underlying type. + GetAutoMLVertical() *AutoMLVertical +} + +// BaseEnvironmentSourceClassification provides polymorphic access to related types. +// Call the interface's GetBaseEnvironmentSource() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BaseEnvironmentID, *BaseEnvironmentSource +type BaseEnvironmentSourceClassification interface { + // GetBaseEnvironmentSource returns the BaseEnvironmentSource content of the underlying type. + GetBaseEnvironmentSource() *BaseEnvironmentSource +} + +// BatchDeploymentConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetBatchDeploymentConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BatchDeploymentConfiguration, *BatchPipelineComponentDeploymentConfiguration +type BatchDeploymentConfigurationClassification interface { + // GetBatchDeploymentConfiguration returns the BatchDeploymentConfiguration content of the underlying type. + GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration +} + +// ComputeClassification provides polymorphic access to related types. +// Call the interface's GetCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AKS, *AmlCompute, *Compute, *ComputeInstance, *DataFactory, *DataLakeAnalytics, *Databricks, *HDInsight, *Kubernetes, +// - *SynapseSpark, *VirtualMachine +type ComputeClassification interface { + // GetCompute returns the Compute content of the underlying type. + GetCompute() *Compute +} + +// ComputeSecretsClassification provides polymorphic access to related types. +// Call the interface's GetComputeSecrets() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AksComputeSecrets, *ComputeSecrets, *DatabricksComputeSecrets, *VirtualMachineSecrets +type ComputeSecretsClassification interface { + // GetComputeSecrets returns the ComputeSecrets content of the underlying type. + GetComputeSecrets() *ComputeSecrets +} + +// DataDriftMetricThresholdBaseClassification provides polymorphic access to related types. +// Call the interface's GetDataDriftMetricThresholdBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CategoricalDataDriftMetricThreshold, *DataDriftMetricThresholdBase, *NumericalDataDriftMetricThreshold +type DataDriftMetricThresholdBaseClassification interface { + // GetDataDriftMetricThresholdBase returns the DataDriftMetricThresholdBase content of the underlying type. + GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase +} + +// DataImportSourceClassification provides polymorphic access to related types. +// Call the interface's GetDataImportSource() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DataImportSource, *DatabaseSource, *FileSystemSource +type DataImportSourceClassification interface { + // GetDataImportSource returns the DataImportSource content of the underlying type. + GetDataImportSource() *DataImportSource +} + +// DataQualityMetricThresholdBaseClassification provides polymorphic access to related types. +// Call the interface's GetDataQualityMetricThresholdBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CategoricalDataQualityMetricThreshold, *DataQualityMetricThresholdBase, *NumericalDataQualityMetricThreshold +type DataQualityMetricThresholdBaseClassification interface { + // GetDataQualityMetricThresholdBase returns the DataQualityMetricThresholdBase content of the underlying type. + GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase +} + +// DataReferenceCredentialClassification provides polymorphic access to related types. +// Call the interface's GetDataReferenceCredential() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AnonymousAccessCredential, *DataReferenceCredential, *DockerCredential, *ManagedIdentityCredential, *SASCredential +type DataReferenceCredentialClassification interface { + // GetDataReferenceCredential returns the DataReferenceCredential content of the underlying type. + GetDataReferenceCredential() *DataReferenceCredential +} + +// DataVersionBasePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetDataVersionBaseProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DataVersionBaseProperties, *MLTableData, *URIFileDataVersion, *URIFolderDataVersion +type DataVersionBasePropertiesClassification interface { + // GetDataVersionBaseProperties returns the DataVersionBaseProperties content of the underlying type. + GetDataVersionBaseProperties() *DataVersionBaseProperties +} + +// DatastoreCredentialsClassification provides polymorphic access to related types. +// Call the interface's GetDatastoreCredentials() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccountKeyDatastoreCredentials, *CertificateDatastoreCredentials, *DatastoreCredentials, *KerberosKeytabCredentials, +// - *KerberosPasswordCredentials, *NoneDatastoreCredentials, *SasDatastoreCredentials, *ServicePrincipalDatastoreCredentials +type DatastoreCredentialsClassification interface { + // GetDatastoreCredentials returns the DatastoreCredentials content of the underlying type. + GetDatastoreCredentials() *DatastoreCredentials +} + +// DatastorePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetDatastoreProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBlobDatastore, *AzureDataLakeGen1Datastore, *AzureDataLakeGen2Datastore, *AzureFileDatastore, *DatastoreProperties, +// - *HdfsDatastore, *OneLakeDatastore +type DatastorePropertiesClassification interface { + // GetDatastoreProperties returns the DatastoreProperties content of the underlying type. + GetDatastoreProperties() *DatastoreProperties +} + +// DatastoreSecretsClassification provides polymorphic access to related types. +// Call the interface's GetDatastoreSecrets() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccountKeyDatastoreSecrets, *CertificateDatastoreSecrets, *DatastoreSecrets, *KerberosKeytabSecrets, *KerberosPasswordSecrets, +// - *SasDatastoreSecrets, *ServicePrincipalDatastoreSecrets +type DatastoreSecretsClassification interface { + // GetDatastoreSecrets returns the DatastoreSecrets content of the underlying type. + GetDatastoreSecrets() *DatastoreSecrets +} + +// DistributionConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetDistributionConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DistributionConfiguration, *Mpi, *PyTorch, *Ray, *TensorFlow +type DistributionConfigurationClassification interface { + // GetDistributionConfiguration returns the DistributionConfiguration content of the underlying type. + GetDistributionConfiguration() *DistributionConfiguration +} + +// EarlyTerminationPolicyClassification provides polymorphic access to related types. +// Call the interface's GetEarlyTerminationPolicy() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BanditPolicy, *EarlyTerminationPolicy, *MedianStoppingPolicy, *TruncationSelectionPolicy +type EarlyTerminationPolicyClassification interface { + // GetEarlyTerminationPolicy returns the EarlyTerminationPolicy content of the underlying type. + GetEarlyTerminationPolicy() *EarlyTerminationPolicy +} + +// ExportSummaryClassification provides polymorphic access to related types. +// Call the interface's GetExportSummary() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CSVExportSummary, *CocoExportSummary, *DatasetExportSummary, *ExportSummary +type ExportSummaryClassification interface { + // GetExportSummary returns the ExportSummary content of the underlying type. + GetExportSummary() *ExportSummary +} + +// ForecastHorizonClassification provides polymorphic access to related types. +// Call the interface's GetForecastHorizon() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoForecastHorizon, *CustomForecastHorizon, *ForecastHorizon +type ForecastHorizonClassification interface { + // GetForecastHorizon returns the ForecastHorizon content of the underlying type. + GetForecastHorizon() *ForecastHorizon +} + +// IdentityConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetIdentityConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AmlToken, *IdentityConfiguration, *ManagedIdentity, *UserIdentity +type IdentityConfigurationClassification interface { + // GetIdentityConfiguration returns the IdentityConfiguration content of the underlying type. + GetIdentityConfiguration() *IdentityConfiguration +} + +// InferencingServerClassification provides polymorphic access to related types. +// Call the interface's GetInferencingServer() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureMLBatchInferencingServer, *AzureMLOnlineInferencingServer, *CustomInferencingServer, *InferencingServer, *TritonInferencingServer +type InferencingServerClassification interface { + // GetInferencingServer returns the InferencingServer content of the underlying type. + GetInferencingServer() *InferencingServer +} + +// JobBasePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetJobBaseProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoMLJob, *CommandJob, *JobBaseProperties, *LabelingJobProperties, *PipelineJob, *SparkJob, *SweepJob +type JobBasePropertiesClassification interface { + // GetJobBaseProperties returns the JobBaseProperties content of the underlying type. + GetJobBaseProperties() *JobBaseProperties +} + +// JobInputClassification provides polymorphic access to related types. +// Call the interface's GetJobInput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CustomModelJobInput, *JobInput, *LiteralJobInput, *MLFlowModelJobInput, *MLTableJobInput, *TritonModelJobInput, *URIFileJobInput, +// - *URIFolderJobInput +type JobInputClassification interface { + // GetJobInput returns the JobInput content of the underlying type. + GetJobInput() *JobInput +} + +// JobLimitsClassification provides polymorphic access to related types. +// Call the interface's GetJobLimits() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CommandJobLimits, *JobLimits, *SweepJobLimits +type JobLimitsClassification interface { + // GetJobLimits returns the JobLimits content of the underlying type. + GetJobLimits() *JobLimits +} + +// JobOutputClassification provides polymorphic access to related types. +// Call the interface's GetJobOutput() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CustomModelJobOutput, *JobOutput, *MLFlowModelJobOutput, *MLTableJobOutput, *TritonModelJobOutput, *URIFileJobOutput, +// - *URIFolderJobOutput +type JobOutputClassification interface { + // GetJobOutput returns the JobOutput content of the underlying type. + GetJobOutput() *JobOutput +} + +// LabelingJobMediaPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetLabelingJobMediaProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *LabelingJobImageProperties, *LabelingJobMediaProperties, *LabelingJobTextProperties +type LabelingJobMediaPropertiesClassification interface { + // GetLabelingJobMediaProperties returns the LabelingJobMediaProperties content of the underlying type. + GetLabelingJobMediaProperties() *LabelingJobMediaProperties +} + +// MLAssistConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetMLAssistConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *MLAssistConfiguration, *MLAssistConfigurationDisabled, *MLAssistConfigurationEnabled +type MLAssistConfigurationClassification interface { + // GetMLAssistConfiguration returns the MLAssistConfiguration content of the underlying type. + GetMLAssistConfiguration() *MLAssistConfiguration +} + +// ModelPerformanceMetricThresholdBaseClassification provides polymorphic access to related types. +// Call the interface's GetModelPerformanceMetricThresholdBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ClassificationModelPerformanceMetricThreshold, *ModelPerformanceMetricThresholdBase, *RegressionModelPerformanceMetricThreshold +type ModelPerformanceMetricThresholdBaseClassification interface { + // GetModelPerformanceMetricThresholdBase returns the ModelPerformanceMetricThresholdBase content of the underlying type. + GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase +} + +// MonitorComputeConfigurationBaseClassification provides polymorphic access to related types. +// Call the interface's GetMonitorComputeConfigurationBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *MonitorComputeConfigurationBase, *MonitorServerlessSparkCompute +type MonitorComputeConfigurationBaseClassification interface { + // GetMonitorComputeConfigurationBase returns the MonitorComputeConfigurationBase content of the underlying type. + GetMonitorComputeConfigurationBase() *MonitorComputeConfigurationBase +} + +// MonitorComputeIdentityBaseClassification provides polymorphic access to related types. +// Call the interface's GetMonitorComputeIdentityBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AmlTokenComputeIdentity, *ManagedComputeIdentity, *MonitorComputeIdentityBase +type MonitorComputeIdentityBaseClassification interface { + // GetMonitorComputeIdentityBase returns the MonitorComputeIdentityBase content of the underlying type. + GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase +} + +// MonitoringFeatureFilterBaseClassification provides polymorphic access to related types. +// Call the interface's GetMonitoringFeatureFilterBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AllFeatures, *FeatureSubset, *MonitoringFeatureFilterBase, *TopNFeaturesByAttribution +type MonitoringFeatureFilterBaseClassification interface { + // GetMonitoringFeatureFilterBase returns the MonitoringFeatureFilterBase content of the underlying type. + GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase +} + +// MonitoringInputDataBaseClassification provides polymorphic access to related types. +// Call the interface's GetMonitoringInputDataBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *FixedInputData, *MonitoringInputDataBase, *RollingInputData, *StaticInputData +type MonitoringInputDataBaseClassification interface { + // GetMonitoringInputDataBase returns the MonitoringInputDataBase content of the underlying type. + GetMonitoringInputDataBase() *MonitoringInputDataBase +} + +// MonitoringSignalBaseClassification provides polymorphic access to related types. +// Call the interface's GetMonitoringSignalBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CustomMonitoringSignal, *DataDriftMonitoringSignal, *DataQualityMonitoringSignal, *FeatureAttributionDriftMonitoringSignal, +// - *GenerationSafetyQualityMonitoringSignal, *GenerationTokenUsageSignal, *ModelPerformanceSignal, *MonitoringSignalBase, +// - *PredictionDriftMonitoringSignal +type MonitoringSignalBaseClassification interface { + // GetMonitoringSignalBase returns the MonitoringSignalBase content of the underlying type. + GetMonitoringSignalBase() *MonitoringSignalBase +} + +// NCrossValidationsClassification provides polymorphic access to related types. +// Call the interface's GetNCrossValidations() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoNCrossValidations, *CustomNCrossValidations, *NCrossValidations +type NCrossValidationsClassification interface { + // GetNCrossValidations returns the NCrossValidations content of the underlying type. + GetNCrossValidations() *NCrossValidations +} + +// NodesClassification provides polymorphic access to related types. +// Call the interface's GetNodes() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AllNodes, *Nodes +type NodesClassification interface { + // GetNodes returns the Nodes content of the underlying type. + GetNodes() *Nodes +} + +// OneLakeArtifactClassification provides polymorphic access to related types. +// Call the interface's GetOneLakeArtifact() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *LakeHouseArtifact, *OneLakeArtifact +type OneLakeArtifactClassification interface { + // GetOneLakeArtifact returns the OneLakeArtifact content of the underlying type. + GetOneLakeArtifact() *OneLakeArtifact +} + +// OnlineDeploymentPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetOnlineDeploymentProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *KubernetesOnlineDeployment, *ManagedOnlineDeployment, *OnlineDeploymentProperties +type OnlineDeploymentPropertiesClassification interface { + // GetOnlineDeploymentProperties returns the OnlineDeploymentProperties content of the underlying type. + GetOnlineDeploymentProperties() *OnlineDeploymentProperties +} + +// OnlineScaleSettingsClassification provides polymorphic access to related types. +// Call the interface's GetOnlineScaleSettings() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DefaultScaleSettings, *OnlineScaleSettings, *TargetUtilizationScaleSettings +type OnlineScaleSettingsClassification interface { + // GetOnlineScaleSettings returns the OnlineScaleSettings content of the underlying type. + GetOnlineScaleSettings() *OnlineScaleSettings +} + +// OutboundRuleClassification provides polymorphic access to related types. +// Call the interface's GetOutboundRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *FqdnOutboundRule, *OutboundRule, *PrivateEndpointOutboundRule, *ServiceTagOutboundRule +type OutboundRuleClassification interface { + // GetOutboundRule returns the OutboundRule content of the underlying type. + GetOutboundRule() *OutboundRule +} + +// PackageInputPathBaseClassification provides polymorphic access to related types. +// Call the interface's GetPackageInputPathBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PackageInputPathBase, *PackageInputPathID, *PackageInputPathURL, *PackageInputPathVersion +type PackageInputPathBaseClassification interface { + // GetPackageInputPathBase returns the PackageInputPathBase content of the underlying type. + GetPackageInputPathBase() *PackageInputPathBase +} + +// PendingUploadCredentialDtoClassification provides polymorphic access to related types. +// Call the interface's GetPendingUploadCredentialDto() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PendingUploadCredentialDto, *SASCredentialDto +type PendingUploadCredentialDtoClassification interface { + // GetPendingUploadCredentialDto returns the PendingUploadCredentialDto content of the underlying type. + GetPendingUploadCredentialDto() *PendingUploadCredentialDto +} + +// PredictionDriftMetricThresholdBaseClassification provides polymorphic access to related types. +// Call the interface's GetPredictionDriftMetricThresholdBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CategoricalPredictionDriftMetricThreshold, *NumericalPredictionDriftMetricThreshold, *PredictionDriftMetricThresholdBase +type PredictionDriftMetricThresholdBaseClassification interface { + // GetPredictionDriftMetricThresholdBase returns the PredictionDriftMetricThresholdBase content of the underlying type. + GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase +} + +// SamplingAlgorithmClassification provides polymorphic access to related types. +// Call the interface's GetSamplingAlgorithm() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BayesianSamplingAlgorithm, *GridSamplingAlgorithm, *RandomSamplingAlgorithm, *SamplingAlgorithm +type SamplingAlgorithmClassification interface { + // GetSamplingAlgorithm returns the SamplingAlgorithm content of the underlying type. + GetSamplingAlgorithm() *SamplingAlgorithm +} + +// ScheduleActionBaseClassification provides polymorphic access to related types. +// Call the interface's GetScheduleActionBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CreateMonitorAction, *EndpointScheduleAction, *ImportDataAction, *JobScheduleAction, *ScheduleActionBase +type ScheduleActionBaseClassification interface { + // GetScheduleActionBase returns the ScheduleActionBase content of the underlying type. + GetScheduleActionBase() *ScheduleActionBase +} + +// SeasonalityClassification provides polymorphic access to related types. +// Call the interface's GetSeasonality() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoSeasonality, *CustomSeasonality, *Seasonality +type SeasonalityClassification interface { + // GetSeasonality returns the Seasonality content of the underlying type. + GetSeasonality() *Seasonality +} + +// SparkJobEntryClassification provides polymorphic access to related types. +// Call the interface's GetSparkJobEntry() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *SparkJobEntry, *SparkJobPythonEntry, *SparkJobScalaEntry +type SparkJobEntryClassification interface { + // GetSparkJobEntry returns the SparkJobEntry content of the underlying type. + GetSparkJobEntry() *SparkJobEntry +} + +// TargetLagsClassification provides polymorphic access to related types. +// Call the interface's GetTargetLags() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoTargetLags, *CustomTargetLags, *TargetLags +type TargetLagsClassification interface { + // GetTargetLags returns the TargetLags content of the underlying type. + GetTargetLags() *TargetLags +} + +// TargetRollingWindowSizeClassification provides polymorphic access to related types. +// Call the interface's GetTargetRollingWindowSize() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutoTargetRollingWindowSize, *CustomTargetRollingWindowSize, *TargetRollingWindowSize +type TargetRollingWindowSizeClassification interface { + // GetTargetRollingWindowSize returns the TargetRollingWindowSize content of the underlying type. + GetTargetRollingWindowSize() *TargetRollingWindowSize +} + +// TriggerBaseClassification provides polymorphic access to related types. +// Call the interface's GetTriggerBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CronTrigger, *RecurrenceTrigger, *TriggerBase +type TriggerBaseClassification interface { + // GetTriggerBase returns the TriggerBase content of the underlying type. + GetTriggerBase() *TriggerBase +} + +// WebhookClassification provides polymorphic access to related types. +// Call the interface's GetWebhook() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureDevOpsWebhook, *Webhook +type WebhookClassification interface { + // GetWebhook returns the Webhook content of the underlying type. + GetWebhook() *Webhook +} + +// WorkspaceConnectionPropertiesV2Classification provides polymorphic access to related types. +// Call the interface's GetWorkspaceConnectionPropertiesV2() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *APIKeyAuthWorkspaceConnectionProperties, *AccessKeyAuthTypeWorkspaceConnectionProperties, *CustomKeysWorkspaceConnectionProperties, +// - *ManagedIdentityAuthTypeWorkspaceConnectionProperties, *NoneAuthTypeWorkspaceConnectionProperties, *PATAuthTypeWorkspaceConnectionProperties, +// - *SASAuthTypeWorkspaceConnectionProperties, *ServicePrincipalAuthTypeWorkspaceConnectionProperties, *UsernamePasswordAuthTypeWorkspaceConnectionProperties, +// - *WorkspaceConnectionPropertiesV2 +type WorkspaceConnectionPropertiesV2Classification interface { + // GetWorkspaceConnectionPropertiesV2 returns the WorkspaceConnectionPropertiesV2 content of the underlying type. + GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client.go index a5efdcbca484..117a3a4cd890 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -18,6 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -33,7 +33,7 @@ type JobsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { - cl, err := arm.NewClient(moduleName+".JobsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,7 +47,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCancel - Cancels a Job (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - id - The name and identifier for the Job. This is case-sensitive. @@ -58,31 +58,41 @@ func (client *JobsClient) BeginCancel(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JobsClientCancelResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JobsClientCancelResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[JobsClientCancelResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JobsClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Cancel - Cancels a Job (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *JobsClient) cancel(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginCancelOptions) (*http.Response, error) { + var err error + const operationName = "JobsClient.BeginCancel" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.cancelCreateRequest(ctx, resourceGroupName, workspaceName, id, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // cancelCreateRequest creates the Cancel request. @@ -109,34 +119,42 @@ func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// CreateOrUpdate - Creates and executes a Job. +// CreateOrUpdate - Creates and executes a Job. For update case, the Tags in the definition passed in will replace Tags in +// the existing job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - id - The name and identifier for the Job. This is case-sensitive. // - body - Job definition object. // - options - JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. func (client *JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, id string, body JobBase, options *JobsClientCreateOrUpdateOptions) (JobsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "JobsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, id, body, options) if err != nil { return JobsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return JobsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return JobsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -163,10 +181,13 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -181,7 +202,7 @@ func (client *JobsClient) createOrUpdateHandleResponse(resp *http.Response) (Job // BeginDelete - Deletes a Job (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - id - The name and identifier for the Job. This is case-sensitive. @@ -192,29 +213,41 @@ func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller[JobsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JobsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[JobsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JobsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Deletes a Job (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "JobsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, id, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -241,7 +274,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,24 +283,31 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Gets a Job by name/id. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - id - The name and identifier for the Job. This is case-sensitive. // - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { + var err error + const operationName = "JobsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, id, options) if err != nil { return JobsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -294,7 +334,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +351,7 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR // NewListPager - Lists Jobs in the workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. @@ -321,25 +361,20 @@ func (client *JobsClient) NewListPager(resourceGroupName string, workspaceName s return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *JobsClientListResponse) (JobsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return JobsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "JobsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return JobsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -363,7 +398,7 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } @@ -376,6 +411,18 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupNa if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } + if options != nil && options.AssetName != nil { + reqQP.Set("assetName", *options.AssetName) + } + if options != nil && options.Scheduled != nil { + reqQP.Set("scheduled", strconv.FormatBool(*options.Scheduled)) + } + if options != nil && options.ScheduleID != nil { + reqQP.Set("scheduleId", *options.ScheduleID) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,3 +436,76 @@ func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientLis } return result, nil } + +// Update - Updates a Job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the Job. This is case-sensitive. +// - body - Job definition to apply during the operation. +// - options - JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method. +func (client *JobsClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, id string, body PartialJobBasePartialResource, options *JobsClientUpdateOptions) (JobsClientUpdateResponse, error) { + var err error + const operationName = "JobsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, id, body, options) + if err != nil { + return JobsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return JobsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, body PartialJobBasePartialResource, options *JobsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *JobsClient) updateHandleResponse(resp *http.Response) (JobsClientUpdateResponse, error) { + result := JobsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobBase); err != nil { + return JobsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client_example_test.go deleted file mode 100644 index 9428c4ecfeb3..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client_example_test.go +++ /dev/null @@ -1,1500 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/list.json -func ExampleJobsClient_NewListPager_listAutoMlJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.JobsClientListOptions{Skip: nil, - JobType: nil, - Tag: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobBaseResourceArmPaginatedResult = armmachinelearning.JobBaseResourceArmPaginatedResult{ - // Value: []*armmachinelearning.JobBase{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeManagedIdentity), - // }, - // Properties: &armmachinelearning.AutoMLJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // Identity: &armmachinelearning.AmlToken{ - // IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - // }, - // IsArchived: to.Ptr(false), - // JobType: to.Ptr(armmachinelearning.JobTypeAutoML), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatus("Scheduled")), - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad": nil, - // }, - // }, - // }, - // TaskDetails: &armmachinelearning.ImageClassification{ - // TargetColumnName: to.Ptr("string"), - // TaskType: to.Ptr(armmachinelearning.TaskTypeImageClassification), - // TrainingData: &armmachinelearning.MLTableJobInput{ - // URI: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeMltable), - // }, - // LimitSettings: &armmachinelearning.ImageLimitSettings{ - // MaxTrials: to.Ptr[int32](2), - // }, - // ModelSettings: &armmachinelearning.ImageModelSettingsClassification{ - // ValidationCropSize: to.Ptr[int32](2), - // }, - // SearchSpace: []*armmachinelearning.ImageModelDistributionSettingsClassification{ - // { - // ValidationCropSize: to.Ptr("choice(2, 360)"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/list.json -func ExampleJobsClient_NewListPager_listCommandJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.JobsClientListOptions{Skip: nil, - JobType: to.Ptr("string"), - Tag: to.Ptr("string"), - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobBaseResourceArmPaginatedResult = armmachinelearning.JobBaseResourceArmPaginatedResult{ - // Value: []*armmachinelearning.JobBase{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CommandJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // Identity: &armmachinelearning.AmlToken{ - // IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - // }, - // JobType: to.Ptr(armmachinelearning.JobTypeCommand), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // CodeID: to.Ptr("string"), - // Command: to.Ptr("string"), - // Distribution: &armmachinelearning.TensorFlow{ - // DistributionType: to.Ptr(armmachinelearning.DistributionTypeTensorFlow), - // ParameterServerCount: to.Ptr[int32](1), - // WorkerCount: to.Ptr[int32](1), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Inputs: map[string]armmachinelearning.JobInputClassification{ - // "string": &armmachinelearning.LiteralJobInput{ - // Description: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - // Value: to.Ptr("string"), - // }, - // }, - // Limits: &armmachinelearning.CommandJobLimits{ - // JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeCommand), - // Timeout: to.Ptr("PT5M"), - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Parameters: map[string]any{ - // "string": "string", - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "7aad5998-6c83-4ca9-b50a-b44dfc43f420": nil, - // }, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/list.json -func ExampleJobsClient_NewListPager_listPipelineJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.JobsClientListOptions{Skip: nil, - JobType: to.Ptr("string"), - Tag: to.Ptr("string"), - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobBaseResourceArmPaginatedResult = armmachinelearning.JobBaseResourceArmPaginatedResult{ - // Value: []*armmachinelearning.JobBase{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.PipelineJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // JobType: to.Ptr(armmachinelearning.JobTypePipeline), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // Inputs: map[string]armmachinelearning.JobInputClassification{ - // "string": &armmachinelearning.LiteralJobInput{ - // Description: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - // Value: to.Ptr("string"), - // }, - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeUpload), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Settings: map[string]any{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/list.json -func ExampleJobsClient_NewListPager_listSweepJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.JobsClientListOptions{Skip: nil, - JobType: to.Ptr("string"), - Tag: to.Ptr("string"), - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobBaseResourceArmPaginatedResult = armmachinelearning.JobBaseResourceArmPaginatedResult{ - // Value: []*armmachinelearning.JobBase{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.SweepJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // JobType: to.Ptr(armmachinelearning.JobTypeSweep), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // EarlyTermination: &armmachinelearning.MedianStoppingPolicy{ - // DelayEvaluation: to.Ptr[int32](1), - // EvaluationInterval: to.Ptr[int32](1), - // PolicyType: to.Ptr(armmachinelearning.EarlyTerminationPolicyTypeMedianStopping), - // }, - // Limits: &armmachinelearning.SweepJobLimits{ - // JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeSweep), - // MaxConcurrentTrials: to.Ptr[int32](1), - // MaxTotalTrials: to.Ptr[int32](1), - // TrialTimeout: to.Ptr("PT1S"), - // }, - // Objective: &armmachinelearning.Objective{ - // Goal: to.Ptr(armmachinelearning.GoalMinimize), - // PrimaryMetric: to.Ptr("string"), - // }, - // SamplingAlgorithm: &armmachinelearning.GridSamplingAlgorithm{ - // SamplingAlgorithmType: to.Ptr(armmachinelearning.SamplingAlgorithmTypeGrid), - // }, - // SearchSpace: map[string]any{ - // "string":map[string]any{ - // }, - // }, - // Trial: &armmachinelearning.TrialComponent{ - // CodeID: to.Ptr("string"), - // Command: to.Ptr("string"), - // Distribution: &armmachinelearning.Mpi{ - // DistributionType: to.Ptr(armmachinelearning.DistributionTypeMpi), - // ProcessCountPerInstance: to.Ptr[int32](1), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "e6b6493e-7d5e-4db3-be1e-306ec641327e": nil, - // }, - // }, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/delete.json -func ExampleJobsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/get.json -func ExampleJobsClient_Get_getAutoMlJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeManagedIdentity), - // }, - // Properties: &armmachinelearning.AutoMLJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // Identity: &armmachinelearning.AmlToken{ - // IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - // }, - // IsArchived: to.Ptr(false), - // JobType: to.Ptr(armmachinelearning.JobTypeAutoML), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatus("Scheduled")), - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad": nil, - // }, - // }, - // }, - // TaskDetails: &armmachinelearning.ImageClassification{ - // TargetColumnName: to.Ptr("string"), - // TaskType: to.Ptr(armmachinelearning.TaskTypeImageClassification), - // TrainingData: &armmachinelearning.MLTableJobInput{ - // URI: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeMltable), - // }, - // LimitSettings: &armmachinelearning.ImageLimitSettings{ - // MaxTrials: to.Ptr[int32](2), - // }, - // ModelSettings: &armmachinelearning.ImageModelSettingsClassification{ - // ValidationCropSize: to.Ptr[int32](2), - // }, - // SearchSpace: []*armmachinelearning.ImageModelDistributionSettingsClassification{ - // { - // ValidationCropSize: to.Ptr("choice(2, 360)"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/get.json -func ExampleJobsClient_Get_getCommandJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CommandJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // Identity: &armmachinelearning.AmlToken{ - // IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - // }, - // JobType: to.Ptr(armmachinelearning.JobTypeCommand), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // CodeID: to.Ptr("string"), - // Command: to.Ptr("string"), - // Distribution: &armmachinelearning.TensorFlow{ - // DistributionType: to.Ptr(armmachinelearning.DistributionTypeTensorFlow), - // ParameterServerCount: to.Ptr[int32](1), - // WorkerCount: to.Ptr[int32](1), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Inputs: map[string]armmachinelearning.JobInputClassification{ - // "string": &armmachinelearning.LiteralJobInput{ - // Description: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - // Value: to.Ptr("string"), - // }, - // }, - // Limits: &armmachinelearning.CommandJobLimits{ - // JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeCommand), - // Timeout: to.Ptr("PT5M"), - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Parameters: map[string]any{ - // "string": "string", - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "8385cf05-78c0-41ef-b31d-36796a678e19": nil, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/get.json -func ExampleJobsClient_Get_getPipelineJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.PipelineJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // JobType: to.Ptr(armmachinelearning.JobTypePipeline), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // Inputs: map[string]armmachinelearning.JobInputClassification{ - // "string": &armmachinelearning.LiteralJobInput{ - // Description: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - // Value: to.Ptr("string"), - // }, - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeUpload), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Settings: map[string]any{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/get.json -func ExampleJobsClient_Get_getSweepJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.SweepJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // JobType: to.Ptr(armmachinelearning.JobTypeSweep), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // EarlyTermination: &armmachinelearning.MedianStoppingPolicy{ - // DelayEvaluation: to.Ptr[int32](1), - // EvaluationInterval: to.Ptr[int32](1), - // PolicyType: to.Ptr(armmachinelearning.EarlyTerminationPolicyTypeMedianStopping), - // }, - // Limits: &armmachinelearning.SweepJobLimits{ - // JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeSweep), - // MaxConcurrentTrials: to.Ptr[int32](1), - // MaxTotalTrials: to.Ptr[int32](1), - // TrialTimeout: to.Ptr("PT1S"), - // }, - // Objective: &armmachinelearning.Objective{ - // Goal: to.Ptr(armmachinelearning.GoalMinimize), - // PrimaryMetric: to.Ptr("string"), - // }, - // SamplingAlgorithm: &armmachinelearning.GridSamplingAlgorithm{ - // SamplingAlgorithmType: to.Ptr(armmachinelearning.SamplingAlgorithmTypeGrid), - // }, - // SearchSpace: map[string]any{ - // "string":map[string]any{ - // }, - // }, - // Trial: &armmachinelearning.TrialComponent{ - // CodeID: to.Ptr("string"), - // Command: to.Ptr("string"), - // Distribution: &armmachinelearning.Mpi{ - // DistributionType: to.Ptr(armmachinelearning.DistributionTypeMpi), - // ProcessCountPerInstance: to.Ptr[int32](1), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "e6b6493e-7d5e-4db3-be1e-306ec641327e": nil, - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/AutoMLJob/createOrUpdate.json -func ExampleJobsClient_CreateOrUpdate_createOrUpdateAutoMlJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.JobBase{ - Properties: &armmachinelearning.AutoMLJob{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - ComputeID: to.Ptr("string"), - DisplayName: to.Ptr("string"), - ExperimentName: to.Ptr("string"), - Identity: &armmachinelearning.AmlToken{ - IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - }, - IsArchived: to.Ptr(false), - JobType: to.Ptr(armmachinelearning.JobTypeAutoML), - Services: map[string]*armmachinelearning.JobService{ - "string": { - Endpoint: to.Ptr("string"), - JobServiceType: to.Ptr("string"), - Port: to.Ptr[int32](1), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - }, - }, - EnvironmentID: to.Ptr("string"), - EnvironmentVariables: map[string]*string{ - "string": to.Ptr("string"), - }, - Outputs: map[string]armmachinelearning.JobOutputClassification{ - "string": &armmachinelearning.URIFileJobOutput{ - Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - URI: to.Ptr("string"), - Description: to.Ptr("string"), - JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - }, - }, - Resources: &armmachinelearning.JobResourceConfiguration{ - InstanceCount: to.Ptr[int32](1), - InstanceType: to.Ptr("string"), - Properties: map[string]any{ - "string": map[string]any{ - "9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad": nil, - }, - }, - }, - TaskDetails: &armmachinelearning.ImageClassification{ - TargetColumnName: to.Ptr("string"), - TaskType: to.Ptr(armmachinelearning.TaskTypeImageClassification), - TrainingData: &armmachinelearning.MLTableJobInput{ - URI: to.Ptr("string"), - JobInputType: to.Ptr(armmachinelearning.JobInputTypeMltable), - }, - LimitSettings: &armmachinelearning.ImageLimitSettings{ - MaxTrials: to.Ptr[int32](2), - }, - ModelSettings: &armmachinelearning.ImageModelSettingsClassification{ - ValidationCropSize: to.Ptr[int32](2), - }, - SearchSpace: []*armmachinelearning.ImageModelDistributionSettingsClassification{ - { - ValidationCropSize: to.Ptr("choice(2, 360)"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeManagedIdentity), - // }, - // Properties: &armmachinelearning.AutoMLJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // Identity: &armmachinelearning.AmlToken{ - // IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - // }, - // IsArchived: to.Ptr(false), - // JobType: to.Ptr(armmachinelearning.JobTypeAutoML), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatus("Scheduled")), - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad": nil, - // }, - // }, - // }, - // TaskDetails: &armmachinelearning.ImageClassification{ - // TargetColumnName: to.Ptr("string"), - // TaskType: to.Ptr(armmachinelearning.TaskTypeImageClassification), - // TrainingData: &armmachinelearning.MLTableJobInput{ - // URI: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeMltable), - // }, - // LimitSettings: &armmachinelearning.ImageLimitSettings{ - // MaxTrials: to.Ptr[int32](2), - // }, - // ModelSettings: &armmachinelearning.ImageModelSettingsClassification{ - // ValidationCropSize: to.Ptr[int32](2), - // }, - // SearchSpace: []*armmachinelearning.ImageModelDistributionSettingsClassification{ - // { - // ValidationCropSize: to.Ptr("choice(2, 360)"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/CommandJob/createOrUpdate.json -func ExampleJobsClient_CreateOrUpdate_createOrUpdateCommandJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.JobBase{ - Properties: &armmachinelearning.CommandJob{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - ComputeID: to.Ptr("string"), - DisplayName: to.Ptr("string"), - ExperimentName: to.Ptr("string"), - Identity: &armmachinelearning.AmlToken{ - IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - }, - JobType: to.Ptr(armmachinelearning.JobTypeCommand), - Services: map[string]*armmachinelearning.JobService{ - "string": { - Endpoint: to.Ptr("string"), - JobServiceType: to.Ptr("string"), - Port: to.Ptr[int32](1), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - }, - }, - CodeID: to.Ptr("string"), - Command: to.Ptr("string"), - Distribution: &armmachinelearning.TensorFlow{ - DistributionType: to.Ptr(armmachinelearning.DistributionTypeTensorFlow), - ParameterServerCount: to.Ptr[int32](1), - WorkerCount: to.Ptr[int32](1), - }, - EnvironmentID: to.Ptr("string"), - EnvironmentVariables: map[string]*string{ - "string": to.Ptr("string"), - }, - Inputs: map[string]armmachinelearning.JobInputClassification{ - "string": &armmachinelearning.LiteralJobInput{ - Description: to.Ptr("string"), - JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - Value: to.Ptr("string"), - }, - }, - Limits: &armmachinelearning.CommandJobLimits{ - JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeCommand), - Timeout: to.Ptr("PT5M"), - }, - Outputs: map[string]armmachinelearning.JobOutputClassification{ - "string": &armmachinelearning.URIFileJobOutput{ - Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - URI: to.Ptr("string"), - Description: to.Ptr("string"), - JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - }, - }, - Resources: &armmachinelearning.JobResourceConfiguration{ - InstanceCount: to.Ptr[int32](1), - InstanceType: to.Ptr("string"), - Properties: map[string]any{ - "string": map[string]any{ - "e6b6493e-7d5e-4db3-be1e-306ec641327e": nil, - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.CommandJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // Identity: &armmachinelearning.AmlToken{ - // IdentityType: to.Ptr(armmachinelearning.IdentityConfigurationTypeAMLToken), - // }, - // JobType: to.Ptr(armmachinelearning.JobTypeCommand), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // CodeID: to.Ptr("string"), - // Command: to.Ptr("string"), - // Distribution: &armmachinelearning.TensorFlow{ - // DistributionType: to.Ptr(armmachinelearning.DistributionTypeTensorFlow), - // ParameterServerCount: to.Ptr[int32](1), - // WorkerCount: to.Ptr[int32](1), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Inputs: map[string]armmachinelearning.JobInputClassification{ - // "string": &armmachinelearning.LiteralJobInput{ - // Description: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - // Value: to.Ptr("string"), - // }, - // }, - // Limits: &armmachinelearning.CommandJobLimits{ - // JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeCommand), - // Timeout: to.Ptr("PT5M"), - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeReadWriteMount), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Parameters: map[string]any{ - // "string": "string", - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "a0847709-f5aa-4561-8ba5-d915d403fdcf": nil, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/PipelineJob/createOrUpdate.json -func ExampleJobsClient_CreateOrUpdate_createOrUpdatePipelineJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.JobBase{ - Properties: &armmachinelearning.PipelineJob{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - ComputeID: to.Ptr("string"), - DisplayName: to.Ptr("string"), - ExperimentName: to.Ptr("string"), - JobType: to.Ptr(armmachinelearning.JobTypePipeline), - Services: map[string]*armmachinelearning.JobService{ - "string": { - Endpoint: to.Ptr("string"), - JobServiceType: to.Ptr("string"), - Port: to.Ptr[int32](1), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - }, - }, - Inputs: map[string]armmachinelearning.JobInputClassification{ - "string": &armmachinelearning.LiteralJobInput{ - Description: to.Ptr("string"), - JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - Value: to.Ptr("string"), - }, - }, - Outputs: map[string]armmachinelearning.JobOutputClassification{ - "string": &armmachinelearning.URIFileJobOutput{ - Mode: to.Ptr(armmachinelearning.OutputDeliveryModeUpload), - URI: to.Ptr("string"), - Description: to.Ptr("string"), - JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - }, - }, - Settings: map[string]any{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.PipelineJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // JobType: to.Ptr(armmachinelearning.JobTypePipeline), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // Inputs: map[string]armmachinelearning.JobInputClassification{ - // "string": &armmachinelearning.LiteralJobInput{ - // Description: to.Ptr("string"), - // JobInputType: to.Ptr(armmachinelearning.JobInputTypeLiteral), - // Value: to.Ptr("string"), - // }, - // }, - // Outputs: map[string]armmachinelearning.JobOutputClassification{ - // "string": &armmachinelearning.URIFileJobOutput{ - // Mode: to.Ptr(armmachinelearning.OutputDeliveryModeUpload), - // URI: to.Ptr("string"), - // Description: to.Ptr("string"), - // JobOutputType: to.Ptr(armmachinelearning.JobOutputTypeURIFile), - // }, - // }, - // Settings: map[string]any{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/SweepJob/createOrUpdate.json -func ExampleJobsClient_CreateOrUpdate_createOrUpdateSweepJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.JobBase{ - Properties: &armmachinelearning.SweepJob{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - ComputeID: to.Ptr("string"), - DisplayName: to.Ptr("string"), - ExperimentName: to.Ptr("string"), - JobType: to.Ptr(armmachinelearning.JobTypeSweep), - Services: map[string]*armmachinelearning.JobService{ - "string": { - Endpoint: to.Ptr("string"), - JobServiceType: to.Ptr("string"), - Port: to.Ptr[int32](1), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - }, - }, - EarlyTermination: &armmachinelearning.MedianStoppingPolicy{ - DelayEvaluation: to.Ptr[int32](1), - EvaluationInterval: to.Ptr[int32](1), - PolicyType: to.Ptr(armmachinelearning.EarlyTerminationPolicyTypeMedianStopping), - }, - Limits: &armmachinelearning.SweepJobLimits{ - JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeSweep), - MaxConcurrentTrials: to.Ptr[int32](1), - MaxTotalTrials: to.Ptr[int32](1), - TrialTimeout: to.Ptr("PT1S"), - }, - Objective: &armmachinelearning.Objective{ - Goal: to.Ptr(armmachinelearning.GoalMinimize), - PrimaryMetric: to.Ptr("string"), - }, - SamplingAlgorithm: &armmachinelearning.GridSamplingAlgorithm{ - SamplingAlgorithmType: to.Ptr(armmachinelearning.SamplingAlgorithmTypeGrid), - }, - SearchSpace: map[string]any{ - "string": map[string]any{}, - }, - Trial: &armmachinelearning.TrialComponent{ - CodeID: to.Ptr("string"), - Command: to.Ptr("string"), - Distribution: &armmachinelearning.Mpi{ - DistributionType: to.Ptr(armmachinelearning.DistributionTypeMpi), - ProcessCountPerInstance: to.Ptr[int32](1), - }, - EnvironmentID: to.Ptr("string"), - EnvironmentVariables: map[string]*string{ - "string": to.Ptr("string"), - }, - Resources: &armmachinelearning.JobResourceConfiguration{ - InstanceCount: to.Ptr[int32](1), - InstanceType: to.Ptr("string"), - Properties: map[string]any{ - "string": map[string]any{ - "e6b6493e-7d5e-4db3-be1e-306ec641327e": nil, - }, - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobBase = armmachinelearning.JobBase{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.SweepJob{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ComputeID: to.Ptr("string"), - // DisplayName: to.Ptr("string"), - // ExperimentName: to.Ptr("string"), - // JobType: to.Ptr(armmachinelearning.JobTypeSweep), - // Services: map[string]*armmachinelearning.JobService{ - // "string": &armmachinelearning.JobService{ - // Endpoint: to.Ptr("string"), - // ErrorMessage: to.Ptr("string"), - // JobServiceType: to.Ptr("string"), - // Port: to.Ptr[int32](1), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Status: to.Ptr("string"), - // }, - // }, - // Status: to.Ptr(armmachinelearning.JobStatusNotStarted), - // EarlyTermination: &armmachinelearning.MedianStoppingPolicy{ - // DelayEvaluation: to.Ptr[int32](1), - // EvaluationInterval: to.Ptr[int32](1), - // PolicyType: to.Ptr(armmachinelearning.EarlyTerminationPolicyTypeMedianStopping), - // }, - // Limits: &armmachinelearning.SweepJobLimits{ - // JobLimitsType: to.Ptr(armmachinelearning.JobLimitsTypeSweep), - // MaxConcurrentTrials: to.Ptr[int32](1), - // MaxTotalTrials: to.Ptr[int32](1), - // TrialTimeout: to.Ptr("PT1S"), - // }, - // Objective: &armmachinelearning.Objective{ - // Goal: to.Ptr(armmachinelearning.GoalMinimize), - // PrimaryMetric: to.Ptr("string"), - // }, - // SamplingAlgorithm: &armmachinelearning.GridSamplingAlgorithm{ - // SamplingAlgorithmType: to.Ptr(armmachinelearning.SamplingAlgorithmTypeGrid), - // }, - // SearchSpace: map[string]any{ - // "string":map[string]any{ - // }, - // }, - // Trial: &armmachinelearning.TrialComponent{ - // CodeID: to.Ptr("string"), - // Command: to.Ptr("string"), - // Distribution: &armmachinelearning.Mpi{ - // DistributionType: to.Ptr(armmachinelearning.DistributionTypeMpi), - // ProcessCountPerInstance: to.Ptr[int32](1), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Resources: &armmachinelearning.JobResourceConfiguration{ - // InstanceCount: to.Ptr[int32](1), - // InstanceType: to.Ptr("string"), - // Properties: map[string]any{ - // "string": map[string]any{ - // "e6b6493e-7d5e-4db3-be1e-306ec641327e": nil, - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Job/cancel.json -func ExampleJobsClient_BeginCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCancel(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/labelingjobs_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/labelingjobs_client.go new file mode 100644 index 000000000000..1da152c78c8b --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/labelingjobs_client.go @@ -0,0 +1,568 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// LabelingJobsClient contains the methods for the LabelingJobs group. +// Don't use this type directly, use NewLabelingJobsClient() instead. +type LabelingJobsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLabelingJobsClient creates a new instance of LabelingJobsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLabelingJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LabelingJobsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LabelingJobsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a labeling job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the LabelingJob. +// - body - LabelingJob definition object. +// - options - LabelingJobsClientBeginCreateOrUpdateOptions contains the optional parameters for the LabelingJobsClient.BeginCreateOrUpdate +// method. +func (client *LabelingJobsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, id string, body LabelingJob, options *LabelingJobsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LabelingJobsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, id, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LabelingJobsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LabelingJobsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates a labeling job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *LabelingJobsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, id string, body LabelingJob, options *LabelingJobsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "LabelingJobsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, id, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LabelingJobsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, body LabelingJob, options *LabelingJobsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// Delete - Delete a labeling job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the LabelingJob. +// - options - LabelingJobsClientDeleteOptions contains the optional parameters for the LabelingJobsClient.Delete method. +func (client *LabelingJobsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientDeleteOptions) (LabelingJobsClientDeleteResponse, error) { + var err error + const operationName = "LabelingJobsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return LabelingJobsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LabelingJobsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return LabelingJobsClientDeleteResponse{}, err + } + return LabelingJobsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LabelingJobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginExportLabels - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the status +// of the job export operation can be tracked. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the LabelingJob. +// - body - The export summary. +// - options - LabelingJobsClientBeginExportLabelsOptions contains the optional parameters for the LabelingJobsClient.BeginExportLabels +// method. +func (client *LabelingJobsClient) BeginExportLabels(ctx context.Context, resourceGroupName string, workspaceName string, id string, body ExportSummaryClassification, options *LabelingJobsClientBeginExportLabelsOptions) (*runtime.Poller[LabelingJobsClientExportLabelsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.exportLabels(ctx, resourceGroupName, workspaceName, id, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LabelingJobsClientExportLabelsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LabelingJobsClientExportLabelsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ExportLabels - Export labels from a labeling job (asynchronous). Using the URL in the Location header, the status of the +// job export operation can be tracked. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *LabelingJobsClient) exportLabels(ctx context.Context, resourceGroupName string, workspaceName string, id string, body ExportSummaryClassification, options *LabelingJobsClientBeginExportLabelsOptions) (*http.Response, error) { + var err error + const operationName = "LabelingJobsClient.BeginExportLabels" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.exportLabelsCreateRequest(ctx, resourceGroupName, workspaceName, id, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// exportLabelsCreateRequest creates the ExportLabels request. +func (client *LabelingJobsClient) exportLabelsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, body ExportSummaryClassification, options *LabelingJobsClientBeginExportLabelsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/exportLabels" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// Get - Gets a labeling job by name/id. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the LabelingJob. +// - options - LabelingJobsClientGetOptions contains the optional parameters for the LabelingJobsClient.Get method. +func (client *LabelingJobsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientGetOptions) (LabelingJobsClientGetResponse, error) { + var err error + const operationName = "LabelingJobsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return LabelingJobsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LabelingJobsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LabelingJobsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *LabelingJobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LabelingJobsClient) getHandleResponse(resp *http.Response) (LabelingJobsClientGetResponse, error) { + result := LabelingJobsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LabelingJob); err != nil { + return LabelingJobsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists labeling jobs in the workspace. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - options - LabelingJobsClientListOptions contains the optional parameters for the LabelingJobsClient.NewListPager method. +func (client *LabelingJobsClient) NewListPager(resourceGroupName string, workspaceName string, options *LabelingJobsClientListOptions) *runtime.Pager[LabelingJobsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[LabelingJobsClientListResponse]{ + More: func(page LabelingJobsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LabelingJobsClientListResponse) (LabelingJobsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LabelingJobsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return LabelingJobsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *LabelingJobsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *LabelingJobsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *LabelingJobsClient) listHandleResponse(resp *http.Response) (LabelingJobsClientListResponse, error) { + result := LabelingJobsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LabelingJobResourceArmPaginatedResult); err != nil { + return LabelingJobsClientListResponse{}, err + } + return result, nil +} + +// Pause - Pause a labeling job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the LabelingJob. +// - options - LabelingJobsClientPauseOptions contains the optional parameters for the LabelingJobsClient.Pause method. +func (client *LabelingJobsClient) Pause(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientPauseOptions) (LabelingJobsClientPauseResponse, error) { + var err error + const operationName = "LabelingJobsClient.Pause" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.pauseCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return LabelingJobsClientPauseResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LabelingJobsClientPauseResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LabelingJobsClientPauseResponse{}, err + } + resp, err := client.pauseHandleResponse(httpResp) + return resp, err +} + +// pauseCreateRequest creates the Pause request. +func (client *LabelingJobsClient) pauseCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientPauseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/pause" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// pauseHandleResponse handles the Pause response. +func (client *LabelingJobsClient) pauseHandleResponse(resp *http.Response) (LabelingJobsClientPauseResponse, error) { + result := LabelingJobsClientPauseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LabelingJobProperties); err != nil { + return LabelingJobsClientPauseResponse{}, err + } + return result, nil +} + +// BeginResume - Resume a labeling job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - id - The name and identifier for the LabelingJob. +// - options - LabelingJobsClientBeginResumeOptions contains the optional parameters for the LabelingJobsClient.BeginResume +// method. +func (client *LabelingJobsClient) BeginResume(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientBeginResumeOptions) (*runtime.Poller[LabelingJobsClientResumeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.resume(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LabelingJobsClientResumeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LabelingJobsClientResumeResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Resume - Resume a labeling job (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *LabelingJobsClient) resume(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientBeginResumeOptions) (*http.Response, error) { + var err error + const operationName = "LabelingJobsClient.BeginResume" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.resumeCreateRequest(ctx, resourceGroupName, workspaceName, id, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// resumeCreateRequest creates the Resume request. +func (client *LabelingJobsClient) resumeCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, id string, options *LabelingJobsClientBeginResumeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/labelingJobs/{id}/resume" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworkprovisions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworkprovisions_client.go new file mode 100644 index 000000000000..aafbd291adcc --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworkprovisions_client.go @@ -0,0 +1,127 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedNetworkProvisionsClient contains the methods for the ManagedNetworkProvisions group. +// Don't use this type directly, use NewManagedNetworkProvisionsClient() instead. +type ManagedNetworkProvisionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagedNetworkProvisionsClient creates a new instance of ManagedNetworkProvisionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedNetworkProvisionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedNetworkProvisionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedNetworkProvisionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginProvisionManagedNetwork - Provisions the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - options - ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions contains the optional parameters for the ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork +// method. +func (client *ManagedNetworkProvisionsClient) BeginProvisionManagedNetwork(ctx context.Context, resourceGroupName string, workspaceName string, options *ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions) (*runtime.Poller[ManagedNetworkProvisionsClientProvisionManagedNetworkResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.provisionManagedNetwork(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedNetworkProvisionsClientProvisionManagedNetworkResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedNetworkProvisionsClientProvisionManagedNetworkResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ProvisionManagedNetwork - Provisions the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ManagedNetworkProvisionsClient) provisionManagedNetwork(ctx context.Context, resourceGroupName string, workspaceName string, options *ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions) (*http.Response, error) { + var err error + const operationName = "ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.provisionManagedNetworkCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// provisionManagedNetworkCreateRequest creates the ProvisionManagedNetwork request. +func (client *ManagedNetworkProvisionsClient) provisionManagedNetworkCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/provisionManagedNetwork" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworksettingsrule_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworksettingsrule_client.go new file mode 100644 index 000000000000..6f30612f0a80 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworksettingsrule_client.go @@ -0,0 +1,347 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedNetworkSettingsRuleClient contains the methods for the ManagedNetworkSettingsRule group. +// Don't use this type directly, use NewManagedNetworkSettingsRuleClient() instead. +type ManagedNetworkSettingsRuleClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagedNetworkSettingsRuleClient creates a new instance of ManagedNetworkSettingsRuleClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedNetworkSettingsRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedNetworkSettingsRuleClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedNetworkSettingsRuleClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates an outbound rule in the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - ruleName - Name of the workspace managed network outbound rule +// - body - Outbound Rule to be created or updated in the managed network of a machine learning workspace. +// - options - ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate +// method. +func (client *ManagedNetworkSettingsRuleClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, body OutboundRuleBasicResource, options *ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedNetworkSettingsRuleClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, ruleName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedNetworkSettingsRuleClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedNetworkSettingsRuleClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates an outbound rule in the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ManagedNetworkSettingsRuleClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, body OutboundRuleBasicResource, options *ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, ruleName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedNetworkSettingsRuleClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, body OutboundRuleBasicResource, options *ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes an outbound rule from the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - ruleName - Name of the workspace managed network outbound rule +// - options - ManagedNetworkSettingsRuleClientBeginDeleteOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.BeginDelete +// method. +func (client *ManagedNetworkSettingsRuleClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *ManagedNetworkSettingsRuleClientBeginDeleteOptions) (*runtime.Poller[ManagedNetworkSettingsRuleClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, ruleName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedNetworkSettingsRuleClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedNetworkSettingsRuleClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes an outbound rule from the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ManagedNetworkSettingsRuleClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *ManagedNetworkSettingsRuleClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ManagedNetworkSettingsRuleClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, ruleName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedNetworkSettingsRuleClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *ManagedNetworkSettingsRuleClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets an outbound rule from the managed network of a machine learning workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - ruleName - Name of the workspace managed network outbound rule +// - options - ManagedNetworkSettingsRuleClientGetOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.Get +// method. +func (client *ManagedNetworkSettingsRuleClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *ManagedNetworkSettingsRuleClientGetOptions) (ManagedNetworkSettingsRuleClientGetResponse, error) { + var err error + const operationName = "ManagedNetworkSettingsRuleClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, ruleName, options) + if err != nil { + return ManagedNetworkSettingsRuleClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedNetworkSettingsRuleClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedNetworkSettingsRuleClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ManagedNetworkSettingsRuleClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, ruleName string, options *ManagedNetworkSettingsRuleClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if ruleName == "" { + return nil, errors.New("parameter ruleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleName}", url.PathEscape(ruleName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedNetworkSettingsRuleClient) getHandleResponse(resp *http.Response) (ManagedNetworkSettingsRuleClientGetResponse, error) { + result := ManagedNetworkSettingsRuleClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OutboundRuleBasicResource); err != nil { + return ManagedNetworkSettingsRuleClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the managed network outbound rules for a machine learning workspace. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - options - ManagedNetworkSettingsRuleClientListOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.NewListPager +// method. +func (client *ManagedNetworkSettingsRuleClient) NewListPager(resourceGroupName string, workspaceName string, options *ManagedNetworkSettingsRuleClientListOptions) *runtime.Pager[ManagedNetworkSettingsRuleClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedNetworkSettingsRuleClientListResponse]{ + More: func(page ManagedNetworkSettingsRuleClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedNetworkSettingsRuleClientListResponse) (ManagedNetworkSettingsRuleClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedNetworkSettingsRuleClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return ManagedNetworkSettingsRuleClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ManagedNetworkSettingsRuleClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ManagedNetworkSettingsRuleClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagedNetworkSettingsRuleClient) listHandleResponse(resp *http.Response) (ManagedNetworkSettingsRuleClientListResponse, error) { + result := ManagedNetworkSettingsRuleClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OutboundRuleListResult); err != nil { + return ManagedNetworkSettingsRuleClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go index b0815593f0aa..ad51cc1221a2 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type ModelContainersClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewModelContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ModelContainersClient, error) { - cl, err := arm.NewClient(moduleName+".ModelContainersClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewModelContainersClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Create or update container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -56,18 +55,25 @@ func NewModelContainersClient(subscriptionID string, credential azcore.TokenCred // - options - ModelContainersClientCreateOrUpdateOptions contains the optional parameters for the ModelContainersClient.CreateOrUpdate // method. func (client *ModelContainersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ModelContainer, options *ModelContainersClientCreateOrUpdateOptions) (ModelContainersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "ModelContainersClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return ModelContainersClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ModelContainersClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ModelContainersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ModelContainersClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,10 +100,13 @@ func (client *ModelContainersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -112,22 +121,28 @@ func (client *ModelContainersClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Delete container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - options - ModelContainersClientDeleteOptions contains the optional parameters for the ModelContainersClient.Delete method. func (client *ModelContainersClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelContainersClientDeleteOptions) (ModelContainersClientDeleteResponse, error) { + var err error + const operationName = "ModelContainersClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return ModelContainersClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ModelContainersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ModelContainersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ModelContainersClientDeleteResponse{}, err } return ModelContainersClientDeleteResponse{}, nil } @@ -156,7 +171,7 @@ func (client *ModelContainersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -165,24 +180,31 @@ func (client *ModelContainersClient) deleteCreateRequest(ctx context.Context, re // Get - Get container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - options - ModelContainersClientGetOptions contains the optional parameters for the ModelContainersClient.Get method. func (client *ModelContainersClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ModelContainersClientGetOptions) (ModelContainersClientGetResponse, error) { + var err error + const operationName = "ModelContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return ModelContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ModelContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ModelContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ModelContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -209,7 +231,7 @@ func (client *ModelContainersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +248,7 @@ func (client *ModelContainersClient) getHandleResponse(resp *http.Response) (Mod // NewListPager - List model containers. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - ModelContainersClientListOptions contains the optional parameters for the ModelContainersClient.NewListPager @@ -237,25 +259,20 @@ func (client *ModelContainersClient) NewListPager(resourceGroupName string, work return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ModelContainersClientListResponse) (ModelContainersClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ModelContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return ModelContainersClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ModelContainersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ModelContainersClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -279,7 +296,7 @@ func (client *ModelContainersClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client_example_test.go deleted file mode 100644 index 688be0b4e4ef..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client_example_test.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/list.json -func ExampleModelContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewModelContainersClient().NewListPager("testrg123", "workspace123", &armmachinelearning.ModelContainersClientListOptions{Skip: nil, - Count: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ModelContainerResourceArmPaginatedResult = armmachinelearning.ModelContainerResourceArmPaginatedResult{ - // Value: []*armmachinelearning.ModelContainer{ - // { - // Name: to.Ptr("testContainer"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/models"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/models/testContainer"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ModelContainerProperties{ - // Description: to.Ptr("Model container description"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/delete.json -func ExampleModelContainersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewModelContainersClient().Delete(ctx, "testrg123", "workspace123", "testContainer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/get.json -func ExampleModelContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewModelContainersClient().Get(ctx, "testrg123", "workspace123", "testContainer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ModelContainer = armmachinelearning.ModelContainer{ - // Name: to.Ptr("testContainer"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/models"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/models/testContainer"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ModelContainerProperties{ - // Description: to.Ptr("Model container description"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelContainer/createOrUpdate.json -func ExampleModelContainersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewModelContainersClient().CreateOrUpdate(ctx, "testrg123", "workspace123", "testContainer", armmachinelearning.ModelContainer{ - Properties: &armmachinelearning.ModelContainerProperties{ - Description: to.Ptr("Model container description"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ModelContainer = armmachinelearning.ModelContainer{ - // Name: to.Ptr("testContainer"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/models"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspace123/models/testContainer"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // CreatedBy: to.Ptr("John Smith"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T12:00:00.000Z"); return t}()), - // LastModifiedBy: to.Ptr("John Smith"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ModelContainerProperties{ - // Description: to.Ptr("Model container description"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/models.go b/sdk/resourcemanager/machinelearning/armmachinelearning/models.go index e3d3c2569066..30954541d0c8 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/models.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -51,16 +50,16 @@ type AKS struct { // GetCompute implements the ComputeClassification interface for type AKS. func (a *AKS) GetCompute() *Compute { return &Compute{ - ComputeType: a.ComputeType, ComputeLocation: a.ComputeLocation, - ProvisioningState: a.ProvisioningState, - Description: a.Description, + ComputeType: a.ComputeType, CreatedOn: a.CreatedOn, + Description: a.Description, + DisableLocalAuth: a.DisableLocalAuth, + IsAttachedCompute: a.IsAttachedCompute, ModifiedOn: a.ModifiedOn, - ResourceID: a.ResourceID, ProvisioningErrors: a.ProvisioningErrors, - IsAttachedCompute: a.IsAttachedCompute, - DisableLocalAuth: a.DisableLocalAuth, + ProvisioningState: a.ProvisioningState, + ResourceID: a.ResourceID, } } @@ -99,6 +98,84 @@ type AKSSchemaProperties struct { SystemServices []*SystemService } +// APIKeyAuthWorkspaceConnectionProperties - This connection type covers the generic ApiKey auth connection categories, for +// examples: AzureOpenAI: Category:= AzureOpenAI AuthType:= ApiKey (as type discriminator) Credentials:= {ApiKey} as +// Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase} +// CognitiveService: Category:= CognitiveService AuthType:= ApiKey (as type discriminator) Credentials:= {SubscriptionKey} +// as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey +// Target:= ServiceRegion={serviceRegion} +// CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (as type discriminator) Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey +// Target:= +// {Endpoint} +// Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields +type APIKeyAuthWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + + // Api key object for workspace connection credential. + Credentials *WorkspaceConnectionAPIKey + ExpiryTime *time.Time + + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string + + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type APIKeyAuthWorkspaceConnectionProperties. +func (a *APIKeyAuthWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: a.AuthType, + Category: a.Category, + CreatedByWorkspaceArmID: a.CreatedByWorkspaceArmID, + ExpiryTime: a.ExpiryTime, + IsSharedToAll: a.IsSharedToAll, + Metadata: a.Metadata, + Target: a.Target, + } +} + +type AccessKeyAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + Credentials *WorkspaceConnectionAccessKey + ExpiryTime *time.Time + + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string + + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type AccessKeyAuthTypeWorkspaceConnectionProperties. +func (a *AccessKeyAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: a.AuthType, + Category: a.Category, + CreatedByWorkspaceArmID: a.CreatedByWorkspaceArmID, + ExpiryTime: a.ExpiryTime, + IsSharedToAll: a.IsSharedToAll, + Metadata: a.Metadata, + Target: a.Target, + } +} + // AccountKeyDatastoreCredentials - Account key datastore credentials configuration. type AccountKeyDatastoreCredentials struct { // REQUIRED; [Required] Credential type used to authentication with storage. @@ -131,6 +208,26 @@ func (a *AccountKeyDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { } } +// AcrDetails - Details of ACR account to be used for the Registry +type AcrDetails struct { + // Details of system created ACR account to be used for the Registry + SystemCreatedAcrAccount *SystemCreatedAcrAccount + + // Details of user created ACR account to be used for the Registry + UserCreatedAcrAccount *UserCreatedAcrAccount +} + +type ActualCapacityInfo struct { + // Gets or sets the total number of instances for the group. + Allocated *int32 + + // Gets or sets the number of instances which failed to successfully complete assignment. + AssignmentFailed *int32 + + // Gets or sets the number of instances which successfully completed assignment. + AssignmentSuccess *int32 +} + // AksComputeSecrets - Secrets related to a Machine Learning compute based on AKS. type AksComputeSecrets struct { // REQUIRED; The type of compute @@ -182,6 +279,31 @@ type AksNetworkingConfiguration struct { SubnetID *string } +type AllFeatures struct { + // REQUIRED; [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + FilterType *MonitoringFeatureFilterType +} + +// GetMonitoringFeatureFilterBase implements the MonitoringFeatureFilterBaseClassification interface for type AllFeatures. +func (a *AllFeatures) GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase { + return &MonitoringFeatureFilterBase{ + FilterType: a.FilterType, + } +} + +// AllNodes - All nodes means the service will be running on all of the nodes of the job +type AllNodes struct { + // REQUIRED; [Required] Type of the Nodes value + NodesValueType *NodesValueType +} + +// GetNodes implements the NodesClassification interface for type AllNodes. +func (a *AllNodes) GetNodes() *Nodes { + return &Nodes{ + NodesValueType: a.NodesValueType, + } +} + // AmlCompute - An Azure Machine Learning compute. type AmlCompute struct { // REQUIRED; The type of compute @@ -222,16 +344,16 @@ type AmlCompute struct { // GetCompute implements the ComputeClassification interface for type AmlCompute. func (a *AmlCompute) GetCompute() *Compute { return &Compute{ - ComputeType: a.ComputeType, ComputeLocation: a.ComputeLocation, - ProvisioningState: a.ProvisioningState, - Description: a.Description, + ComputeType: a.ComputeType, CreatedOn: a.CreatedOn, + Description: a.Description, + DisableLocalAuth: a.DisableLocalAuth, + IsAttachedCompute: a.IsAttachedCompute, ModifiedOn: a.ModifiedOn, - ResourceID: a.ResourceID, ProvisioningErrors: a.ProvisioningErrors, - IsAttachedCompute: a.IsAttachedCompute, - DisableLocalAuth: a.DisableLocalAuth, + ProvisioningState: a.ProvisioningState, + ResourceID: a.ResourceID, } } @@ -337,39 +459,6 @@ type AmlComputeSchema struct { Properties *AmlComputeProperties } -// AmlOperation - Azure Machine Learning workspace REST API operation -type AmlOperation struct { - // Display name of operation - Display *AmlOperationDisplay - - // Indicates whether the operation applies to data-plane - IsDataAction *bool - - // Operation name: {provider}/{resource}/{operation} - Name *string -} - -// AmlOperationDisplay - Display name of operation -type AmlOperationDisplay struct { - // The description for the operation. - Description *string - - // The operation that users can perform. - Operation *string - - // The resource provider name: Microsoft.MachineLearningExperimentation - Provider *string - - // The resource on which the operation is performed. - Resource *string -} - -// AmlOperationListResult - An array of operations supported by the resource provider. -type AmlOperationListResult struct { - // List of AML workspace operations supported by the AML workspace resource provider. - Value []*AmlOperation -} - // AmlToken - AML Token identity configuration. type AmlToken struct { // REQUIRED; [Required] Specifies the type of identity framework. @@ -383,6 +472,19 @@ func (a *AmlToken) GetIdentityConfiguration() *IdentityConfiguration { } } +// AmlTokenComputeIdentity - AML token compute identity definition. +type AmlTokenComputeIdentity struct { + // REQUIRED; [Required] Monitor compute identity type enum. + ComputeIdentityType *MonitorComputeIdentityType +} + +// GetMonitorComputeIdentityBase implements the MonitorComputeIdentityBaseClassification interface for type AmlTokenComputeIdentity. +func (a *AmlTokenComputeIdentity) GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase { + return &MonitorComputeIdentityBase{ + ComputeIdentityType: a.ComputeIdentityType, + } +} + // AmlUserFeature - Features enabled for a workspace type AmlUserFeature struct { // Describes the feature for user experience @@ -395,14 +497,39 @@ type AmlUserFeature struct { ID *string } +// AnonymousAccessCredential - Access credential with no credentials +type AnonymousAccessCredential struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *DataReferenceCredentialType +} + +// GetDataReferenceCredential implements the DataReferenceCredentialClassification interface for type AnonymousAccessCredential. +func (a *AnonymousAccessCredential) GetDataReferenceCredential() *DataReferenceCredential { + return &DataReferenceCredential{ + CredentialType: a.CredentialType, + } +} + +// ArmResourceID - ARM ResourceId of a resource +type ArmResourceID struct { + // Arm ResourceId is in the format "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Storage/storageAccounts/{StorageAccountName}" + // or + // "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{AcrName}" + ResourceID *string +} + type AssetBase struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. @@ -443,6 +570,15 @@ type AssetJobInput struct { // AssetJobOutput - Asset output type. type AssetJobOutput struct { + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Output Asset Delivery Mode. Mode *OutputDeliveryMode @@ -450,15 +586,6 @@ type AssetJobOutput struct { URI *string } -// AssetReferenceBaseClassification provides polymorphic access to related types. -// Call the interface's GetAssetReferenceBase() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AssetReferenceBase, *DataPathAssetReference, *IDAssetReference, *OutputPathAssetReference -type AssetReferenceBaseClassification interface { - // GetAssetReferenceBase returns the AssetReferenceBase content of the underlying type. - GetAssetReferenceBase() *AssetReferenceBase -} - // AssetReferenceBase - Base definition for asset references. type AssetReferenceBase struct { // REQUIRED; [Required] Specifies the type of asset reference. @@ -477,6 +604,14 @@ type AssignedUser struct { TenantID *string } +type AutoDeleteSetting struct { + // When to check if an asset is expired + Condition *AutoDeleteCondition + + // Expiration condition value. + Value *string +} + // AutoForecastHorizon - Forecast horizon determined automatically by system. type AutoForecastHorizon struct { // REQUIRED; [Required] Set forecast horizon value selection mode. @@ -529,15 +664,24 @@ type AutoMLJob struct { // Is the asset archived? IsArchived *bool + // Notification setting for the job + NotificationSetting *NotificationSetting + // Mapping of output data bindings used in the job. Outputs map[string]JobOutputClassification // The asset property dictionary. Properties map[string]*string + // Queue settings for the job + QueueSettings *QueueSettings + // Compute Resource configuration for the job. Resources *JobResourceConfiguration + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. Services map[string]*JobService @@ -551,29 +695,21 @@ type AutoMLJob struct { // GetJobBaseProperties implements the JobBasePropertiesClassification interface for type AutoMLJob. func (a *AutoMLJob) GetJobBaseProperties() *JobBaseProperties { return &JobBaseProperties{ - ComponentID: a.ComponentID, - ComputeID: a.ComputeID, - DisplayName: a.DisplayName, - ExperimentName: a.ExperimentName, - Identity: a.Identity, - IsArchived: a.IsArchived, - JobType: a.JobType, - Services: a.Services, - Status: a.Status, - Description: a.Description, - Properties: a.Properties, - Tags: a.Tags, - } -} - -// AutoMLVerticalClassification provides polymorphic access to related types. -// Call the interface's GetAutoMLVertical() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoMLVertical, *Classification, *Forecasting, *ImageClassification, *ImageClassificationMultilabel, *ImageInstanceSegmentation, -// - *ImageObjectDetection, *Regression, *TextClassification, *TextClassificationMultilabel, *TextNer -type AutoMLVerticalClassification interface { - // GetAutoMLVertical returns the AutoMLVertical content of the underlying type. - GetAutoMLVertical() *AutoMLVertical + ComponentID: a.ComponentID, + ComputeID: a.ComputeID, + Description: a.Description, + DisplayName: a.DisplayName, + ExperimentName: a.ExperimentName, + Identity: a.Identity, + IsArchived: a.IsArchived, + JobType: a.JobType, + NotificationSetting: a.NotificationSetting, + Properties: a.Properties, + SecretsConfiguration: a.SecretsConfiguration, + Services: a.Services, + Status: a.Status, + Tags: a.Tags, + } } // AutoMLVertical - AutoML vertical class. Base class for AutoML verticals - TableVertical/ImageVertical/NLPVertical @@ -657,6 +793,12 @@ func (a *AutoTargetRollingWindowSize) GetTargetRollingWindowSize() *TargetRollin } } +// AutologgerSettings - Settings for Autologger. +type AutologgerSettings struct { + // REQUIRED; [Required] Indicates whether mlflow autologger is enabled. + MlflowAutologger *MLFlowAutologgerState +} + // AzureBlobDatastore - Azure Blob datastore configuration. type AzureBlobDatastore struct { // REQUIRED; [Required] Account credentials. @@ -677,15 +819,24 @@ type AzureBlobDatastore struct { // Azure cloud endpoint for the storage account. Endpoint *string + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + // The asset property dictionary. Properties map[string]*string // Protocol used to communicate with the storage account. Protocol *string + // Azure Resource Group name + ResourceGroup *string + // Indicates which identity to use to authenticate service data access to customer's storage. ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity + // Azure Subscription Id + SubscriptionID *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string @@ -696,12 +847,13 @@ type AzureBlobDatastore struct { // GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureBlobDatastore. func (a *AzureBlobDatastore) GetDatastoreProperties() *DatastoreProperties { return &DatastoreProperties{ - Credentials: a.Credentials, - DatastoreType: a.DatastoreType, - IsDefault: a.IsDefault, - Description: a.Description, - Properties: a.Properties, - Tags: a.Tags, + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + Description: a.Description, + IntellectualProperty: a.IntellectualProperty, + IsDefault: a.IsDefault, + Properties: a.Properties, + Tags: a.Tags, } } @@ -719,12 +871,21 @@ type AzureDataLakeGen1Datastore struct { // The asset description text. Description *string + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + // The asset property dictionary. Properties map[string]*string + // Azure Resource Group name + ResourceGroup *string + // Indicates which identity to use to authenticate service data access to customer's storage. ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity + // Azure Subscription Id + SubscriptionID *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string @@ -735,12 +896,13 @@ type AzureDataLakeGen1Datastore struct { // GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureDataLakeGen1Datastore. func (a *AzureDataLakeGen1Datastore) GetDatastoreProperties() *DatastoreProperties { return &DatastoreProperties{ - Credentials: a.Credentials, - DatastoreType: a.DatastoreType, - IsDefault: a.IsDefault, - Description: a.Description, - Properties: a.Properties, - Tags: a.Tags, + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + Description: a.Description, + IntellectualProperty: a.IntellectualProperty, + IsDefault: a.IsDefault, + Properties: a.Properties, + Tags: a.Tags, } } @@ -764,15 +926,24 @@ type AzureDataLakeGen2Datastore struct { // Azure cloud endpoint for the storage account. Endpoint *string + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + // The asset property dictionary. Properties map[string]*string // Protocol used to communicate with the storage account. Protocol *string + // Azure Resource Group name + ResourceGroup *string + // Indicates which identity to use to authenticate service data access to customer's storage. ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity + // Azure Subscription Id + SubscriptionID *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string @@ -783,12 +954,39 @@ type AzureDataLakeGen2Datastore struct { // GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureDataLakeGen2Datastore. func (a *AzureDataLakeGen2Datastore) GetDatastoreProperties() *DatastoreProperties { return &DatastoreProperties{ - Credentials: a.Credentials, - DatastoreType: a.DatastoreType, - IsDefault: a.IsDefault, - Description: a.Description, - Properties: a.Properties, - Tags: a.Tags, + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + Description: a.Description, + IntellectualProperty: a.IntellectualProperty, + IsDefault: a.IsDefault, + Properties: a.Properties, + Tags: a.Tags, + } +} + +// AzureDatastore - Base definition for Azure datastore contents configuration. +type AzureDatastore struct { + // Azure Resource Group name + ResourceGroup *string + + // Azure Subscription Id + SubscriptionID *string +} + +// AzureDevOpsWebhook - Webhook details specific for Azure DevOps +type AzureDevOpsWebhook struct { + // REQUIRED; [Required] Specifies the type of service to send a callback + WebhookType *WebhookType + + // Send callback on a specified notification event + EventType *string +} + +// GetWebhook implements the WebhookClassification interface for type AzureDevOpsWebhook. +func (a *AzureDevOpsWebhook) GetWebhook() *Webhook { + return &Webhook{ + EventType: a.EventType, + WebhookType: a.WebhookType, } } @@ -812,15 +1010,24 @@ type AzureFileDatastore struct { // Azure cloud endpoint for the storage account. Endpoint *string + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + // The asset property dictionary. Properties map[string]*string // Protocol used to communicate with the storage account. Protocol *string + // Azure Resource Group name + ResourceGroup *string + // Indicates which identity to use to authenticate service data access to customer's storage. ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity + // Azure Subscription Id + SubscriptionID *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string @@ -831,12 +1038,45 @@ type AzureFileDatastore struct { // GetDatastoreProperties implements the DatastorePropertiesClassification interface for type AzureFileDatastore. func (a *AzureFileDatastore) GetDatastoreProperties() *DatastoreProperties { return &DatastoreProperties{ - Credentials: a.Credentials, - DatastoreType: a.DatastoreType, - IsDefault: a.IsDefault, - Description: a.Description, - Properties: a.Properties, - Tags: a.Tags, + Credentials: a.Credentials, + DatastoreType: a.DatastoreType, + Description: a.Description, + IntellectualProperty: a.IntellectualProperty, + IsDefault: a.IsDefault, + Properties: a.Properties, + Tags: a.Tags, + } +} + +// AzureMLBatchInferencingServer - Azure ML batch inferencing server configurations. +type AzureMLBatchInferencingServer struct { + // REQUIRED; [Required] Inferencing server type for various targets. + ServerType *InferencingServerType + + // Code configuration for AML batch inferencing server. + CodeConfiguration *CodeConfiguration +} + +// GetInferencingServer implements the InferencingServerClassification interface for type AzureMLBatchInferencingServer. +func (a *AzureMLBatchInferencingServer) GetInferencingServer() *InferencingServer { + return &InferencingServer{ + ServerType: a.ServerType, + } +} + +// AzureMLOnlineInferencingServer - Azure ML online inferencing configurations. +type AzureMLOnlineInferencingServer struct { + // REQUIRED; [Required] Inferencing server type for various targets. + ServerType *InferencingServerType + + // Code configuration for AML inferencing server. + CodeConfiguration *CodeConfiguration +} + +// GetInferencingServer implements the InferencingServerClassification interface for type AzureMLOnlineInferencingServer. +func (a *AzureMLOnlineInferencingServer) GetInferencingServer() *InferencingServer { + return &InferencingServer{ + ServerType: a.ServerType, } } @@ -867,6 +1107,30 @@ func (b *BanditPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPolicy { } } +// BaseEnvironmentID - Base environment type. +type BaseEnvironmentID struct { + // REQUIRED; [Required] Base environment type. + BaseEnvironmentSourceType *BaseEnvironmentSourceType + + // REQUIRED; [Required] Resource id accepting ArmId or AzureMlId. + ResourceID *string +} + +// GetBaseEnvironmentSource implements the BaseEnvironmentSourceClassification interface for type BaseEnvironmentID. +func (b *BaseEnvironmentID) GetBaseEnvironmentSource() *BaseEnvironmentSource { + return &BaseEnvironmentSource{ + BaseEnvironmentSourceType: b.BaseEnvironmentSourceType, + } +} + +type BaseEnvironmentSource struct { + // REQUIRED; [Required] Base environment type. + BaseEnvironmentSourceType *BaseEnvironmentSourceType +} + +// GetBaseEnvironmentSource implements the BaseEnvironmentSourceClassification interface for type BaseEnvironmentSource. +func (b *BaseEnvironmentSource) GetBaseEnvironmentSource() *BaseEnvironmentSource { return b } + type BatchDeployment struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -899,6 +1163,17 @@ type BatchDeployment struct { Type *string } +// BatchDeploymentConfiguration - Properties relevant to different deployment types. +type BatchDeploymentConfiguration struct { + // REQUIRED; [Required] The type of the deployment + DeploymentConfigurationType *BatchDeploymentConfigurationType +} + +// GetBatchDeploymentConfiguration implements the BatchDeploymentConfigurationClassification interface for type BatchDeploymentConfiguration. +func (b *BatchDeploymentConfiguration) GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration { + return b +} + // BatchDeploymentProperties - Batch inference settings per deployment. type BatchDeploymentProperties struct { // Code configuration for the endpoint deployment. @@ -907,10 +1182,13 @@ type BatchDeploymentProperties struct { // Compute target for batch inference operation. Compute *string + // Properties relevant to different deployment types. + DeploymentConfiguration BatchDeploymentConfigurationClassification + // Description of the endpoint deployment. Description *string - // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + // ARM resource ID of the environment specification for the endpoint deployment. EnvironmentID *string // Environment variables configuration for the deployment. @@ -963,40 +1241,6 @@ type BatchDeploymentTrackedResourceArmPaginatedResult struct { Value []*BatchDeployment } -// BatchDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginCreateOrUpdate -// method. -type BatchDeploymentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BatchDeploymentsClientBeginDeleteOptions contains the optional parameters for the BatchDeploymentsClient.BeginDelete method. -type BatchDeploymentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BatchDeploymentsClientBeginUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginUpdate method. -type BatchDeploymentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BatchDeploymentsClientGetOptions contains the optional parameters for the BatchDeploymentsClient.Get method. -type BatchDeploymentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BatchDeploymentsClientListOptions contains the optional parameters for the BatchDeploymentsClient.NewListPager method. -type BatchDeploymentsClientListOptions struct { - // Ordering of list. - OrderBy *string - // Continuation token for pagination. - Skip *string - // Top of list. - Top *int32 -} - type BatchEndpoint struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -1042,7 +1286,7 @@ type BatchEndpointProperties struct { // 'Key' doesn't expire but 'AMLToken' does. AuthMode *EndpointAuthMode - // Default values for Batch Endpoint + // Default values for Batch Endpoint. Defaults *BatchEndpointDefaults // Description of the inference endpoint. @@ -1074,41 +1318,29 @@ type BatchEndpointTrackedResourceArmPaginatedResult struct { Value []*BatchEndpoint } -// BatchEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginCreateOrUpdate -// method. -type BatchEndpointsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// BatchPipelineComponentDeploymentConfiguration - Properties for a Batch Pipeline Component Deployment. +type BatchPipelineComponentDeploymentConfiguration struct { + // REQUIRED; [Required] The type of the deployment + DeploymentConfigurationType *BatchDeploymentConfigurationType -// BatchEndpointsClientBeginDeleteOptions contains the optional parameters for the BatchEndpointsClient.BeginDelete method. -type BatchEndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // The ARM id of the component to be run. + ComponentID *IDAssetReference -// BatchEndpointsClientBeginUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginUpdate method. -type BatchEndpointsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} + // The description which will be applied to the job. + Description *string -// BatchEndpointsClientGetOptions contains the optional parameters for the BatchEndpointsClient.Get method. -type BatchEndpointsClientGetOptions struct { - // placeholder for future optional parameters -} + // Run-time settings for the pipeline job. + Settings map[string]*string -// BatchEndpointsClientListKeysOptions contains the optional parameters for the BatchEndpointsClient.ListKeys method. -type BatchEndpointsClientListKeysOptions struct { - // placeholder for future optional parameters + // The tags which will be applied to the job. + Tags map[string]*string } -// BatchEndpointsClientListOptions contains the optional parameters for the BatchEndpointsClient.NewListPager method. -type BatchEndpointsClientListOptions struct { - // Number of endpoints to be retrieved in a page of results. - Count *int32 - // Continuation token for pagination. - Skip *string +// GetBatchDeploymentConfiguration implements the BatchDeploymentConfigurationClassification interface for type BatchPipelineComponentDeploymentConfiguration. +func (b *BatchPipelineComponentDeploymentConfiguration) GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration { + return &BatchDeploymentConfiguration{ + DeploymentConfigurationType: b.DeploymentConfigurationType, + } } // BatchRetrySettings - Retry settings for a batch inference operation. @@ -1133,6 +1365,28 @@ func (b *BayesianSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { } } +type BindOptions struct { + // Indicate whether to create host path. + CreateHostPath *bool + + // Type of Bind Option + Propagation *string + + // Mention the selinux options. + Selinux *string +} + +type BlobReferenceForConsumptionDto struct { + // Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path + BlobURI *string + + // Credential info to access storage account + Credential PendingUploadCredentialDtoClassification + + // Arm ID of the storage account to use + StorageAccountArmID *string +} + // BuildContext - Configuration settings for Docker build context type BuildContext struct { // REQUIRED; [Required] URI of the Docker build context used to build the image. Supports blob URIs on environment creation @@ -1143,67 +1397,211 @@ type BuildContext struct { DockerfilePath *string } -// CertificateDatastoreCredentials - Certificate datastore credentials configuration. -type CertificateDatastoreCredentials struct { - // REQUIRED; [Required] Service principal client ID. - ClientID *string +type CSVExportSummary struct { + // REQUIRED; [Required] The format of exported labels, also as the discriminator. + Format *ExportFormatType - // REQUIRED; [Required] Credential type used to authentication with storage. - CredentialsType *CredentialsType + // READ-ONLY; The container name to which the labels will be exported. + ContainerName *string - // REQUIRED; [Required] Service principal secrets. - Secrets *CertificateDatastoreSecrets + // READ-ONLY; The time when the export was completed. + EndDateTime *time.Time - // REQUIRED; [Required] ID of the tenant to which the service principal belongs. - TenantID *string + // READ-ONLY; The total number of labeled datapoints exported. + ExportedRowCount *int64 - // REQUIRED; [Required] Thumbprint of the certificate used for authentication. - Thumbprint *string + // READ-ONLY; Name and identifier of the job containing exported labels. + LabelingJobID *string - // Authority URL used for authentication. - AuthorityURL *string + // READ-ONLY; The output path where the labels will be exported. + SnapshotPath *string - // Resource the service principal has access to. - ResourceURL *string + // READ-ONLY; The time when the export was requested. + StartDateTime *time.Time } -// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type CertificateDatastoreCredentials. -func (c *CertificateDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { - return &DatastoreCredentials{ - CredentialsType: c.CredentialsType, +// GetExportSummary implements the ExportSummaryClassification interface for type CSVExportSummary. +func (c *CSVExportSummary) GetExportSummary() *ExportSummary { + return &ExportSummary{ + EndDateTime: c.EndDateTime, + ExportedRowCount: c.ExportedRowCount, + Format: c.Format, + LabelingJobID: c.LabelingJobID, + StartDateTime: c.StartDateTime, } } -// CertificateDatastoreSecrets - Datastore certificate secrets. -type CertificateDatastoreSecrets struct { - // REQUIRED; [Required] Credential type used to authentication with storage. - SecretsType *SecretsType +type CapacityReservationGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string - // Service principal certificate. - Certificate *string -} + // REQUIRED; [Required] Additional attributes of the entity. + Properties *CapacityReservationGroupProperties -// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type CertificateDatastoreSecrets. -func (c *CertificateDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { - return &DatastoreSecrets{ - SecretsType: c.SecretsType, - } -} + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity -// Classification task in AutoML Table vertical. -type Classification struct { - // REQUIRED; [Required] Task type for AutoMLJob. - TaskType *TaskType + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string - // REQUIRED; [Required] Training data input. - TrainingData *MLTableJobInput + // Sku details required for ARM contract for Autoscaling. + SKU *SKU - // Columns to use for CVSplit data. + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type CapacityReservationGroupProperties struct { + // REQUIRED; [Required] Specifies the amount of capacity to reserve. + ReservedCapacity *int32 + + // Offer used by this capacity reservation group. + Offer *ServerlessOffer +} + +// CapacityReservationGroupTrackedResourceArmPaginatedResult - A paginated list of CapacityReservationGroup entities. +type CapacityReservationGroupTrackedResourceArmPaginatedResult struct { + // The link to the next page of CapacityReservationGroup objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type CapacityReservationGroup. + Value []*CapacityReservationGroup +} + +type CategoricalDataDriftMetricThreshold struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // REQUIRED; [Required] The categorical data drift metric to calculate. + Metric *CategoricalDataDriftMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetDataDriftMetricThresholdBase implements the DataDriftMetricThresholdBaseClassification interface for type CategoricalDataDriftMetricThreshold. +func (c *CategoricalDataDriftMetricThreshold) GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase { + return &DataDriftMetricThresholdBase{ + DataType: c.DataType, + Threshold: c.Threshold, + } +} + +type CategoricalDataQualityMetricThreshold struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // REQUIRED; [Required] The categorical data quality metric to calculate. + Metric *CategoricalDataQualityMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetDataQualityMetricThresholdBase implements the DataQualityMetricThresholdBaseClassification interface for type CategoricalDataQualityMetricThreshold. +func (c *CategoricalDataQualityMetricThreshold) GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase { + return &DataQualityMetricThresholdBase{ + DataType: c.DataType, + Threshold: c.Threshold, + } +} + +type CategoricalPredictionDriftMetricThreshold struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // REQUIRED; [Required] The categorical prediction drift metric to calculate. + Metric *CategoricalPredictionDriftMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetPredictionDriftMetricThresholdBase implements the PredictionDriftMetricThresholdBaseClassification interface for type +// CategoricalPredictionDriftMetricThreshold. +func (c *CategoricalPredictionDriftMetricThreshold) GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase { + return &PredictionDriftMetricThresholdBase{ + DataType: c.DataType, + Threshold: c.Threshold, + } +} + +// CertificateDatastoreCredentials - Certificate datastore credentials configuration. +type CertificateDatastoreCredentials struct { + // REQUIRED; [Required] Service principal client ID. + ClientID *string + + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType + + // REQUIRED; [Required] Service principal secrets. + Secrets *CertificateDatastoreSecrets + + // REQUIRED; [Required] ID of the tenant to which the service principal belongs. + TenantID *string + + // REQUIRED; [Required] Thumbprint of the certificate used for authentication. + Thumbprint *string + + // Authority URL used for authentication. + AuthorityURL *string + + // Resource the service principal has access to. + ResourceURL *string +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type CertificateDatastoreCredentials. +func (c *CertificateDatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: c.CredentialsType, + } +} + +// CertificateDatastoreSecrets - Datastore certificate secrets. +type CertificateDatastoreSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType + + // Service principal certificate. + Certificate *string +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type CertificateDatastoreSecrets. +func (c *CertificateDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: c.SecretsType, + } +} + +// Classification task in AutoML Table vertical. +type Classification struct { + // REQUIRED; [Required] Task type for AutoMLJob. + TaskType *TaskType + + // REQUIRED; [Required] Training data input. + TrainingData *MLTableJobInput + + // Columns to use for CVSplit data. CvSplitColumnNames []*string // Featurization inputs needed for AutoML job. FeaturizationSettings *TableVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *TableFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *TableVerticalLimitSettings @@ -1219,6 +1617,12 @@ type Classification struct { // Primary metric for the task. PrimaryMetric *ClassificationPrimaryMetrics + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*TableParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *TableSweepSettings + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. TargetColumnName *string @@ -1254,6 +1658,26 @@ func (c *Classification) GetAutoMLVertical() *AutoMLVertical { } } +type ClassificationModelPerformanceMetricThreshold struct { + // REQUIRED; [Required] The classification model performance to calculate. + Metric *ClassificationModelPerformanceMetric + + // REQUIRED; [Required] Specifies the data type of the metric threshold. + ModelType *MonitoringModelType + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetModelPerformanceMetricThresholdBase implements the ModelPerformanceMetricThresholdBaseClassification interface for type +// ClassificationModelPerformanceMetricThreshold. +func (c *ClassificationModelPerformanceMetricThreshold) GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase { + return &ModelPerformanceMetricThresholdBase{ + ModelType: c.ModelType, + Threshold: c.Threshold, + } +} + // ClassificationTrainingSettings - Classification Training related configuration. type ClassificationTrainingSettings struct { // Allowed models for classification task. @@ -1284,6 +1708,12 @@ type ClassificationTrainingSettings struct { // Stack ensemble settings for stack ensemble run. StackEnsembleSettings *StackEnsembleSettings + + // 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. + TrainingMode *TrainingMode } // ClusterUpdateParameters - AmlCompute update parameters. @@ -1298,6 +1728,40 @@ type ClusterUpdateProperties struct { Properties *ScaleSettingsInformation } +type CocoExportSummary struct { + // REQUIRED; [Required] The format of exported labels, also as the discriminator. + Format *ExportFormatType + + // READ-ONLY; The container name to which the labels will be exported. + ContainerName *string + + // READ-ONLY; The time when the export was completed. + EndDateTime *time.Time + + // READ-ONLY; The total number of labeled datapoints exported. + ExportedRowCount *int64 + + // READ-ONLY; Name and identifier of the job containing exported labels. + LabelingJobID *string + + // READ-ONLY; The output path where the labels will be exported. + SnapshotPath *string + + // READ-ONLY; The time when the export was requested. + StartDateTime *time.Time +} + +// GetExportSummary implements the ExportSummaryClassification interface for type CocoExportSummary. +func (c *CocoExportSummary) GetExportSummary() *ExportSummary { + return &ExportSummary{ + EndDateTime: c.EndDateTime, + ExportedRowCount: c.ExportedRowCount, + Format: c.Format, + LabelingJobID: c.LabelingJobID, + StartDateTime: c.StartDateTime, + } +} + // CodeConfiguration - Configuration for a scoring code asset. type CodeConfiguration struct { // REQUIRED; [Required] The script to execute on startup. eg. "score.py" @@ -1344,6 +1808,9 @@ type CodeContainerProperties struct { // READ-ONLY; The next auto incremental version NextVersion *string + + // READ-ONLY; Provisioning state for the code container. + ProvisioningState *AssetProvisioningState } // CodeContainerResourceArmPaginatedResult - A paginated list of CodeContainer entities. @@ -1355,28 +1822,6 @@ type CodeContainerResourceArmPaginatedResult struct { Value []*CodeContainer } -// CodeContainersClientCreateOrUpdateOptions contains the optional parameters for the CodeContainersClient.CreateOrUpdate -// method. -type CodeContainersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// CodeContainersClientDeleteOptions contains the optional parameters for the CodeContainersClient.Delete method. -type CodeContainersClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CodeContainersClientGetOptions contains the optional parameters for the CodeContainersClient.Get method. -type CodeContainersClientGetOptions struct { - // placeholder for future optional parameters -} - -// CodeContainersClientListOptions contains the optional parameters for the CodeContainersClient.NewListPager method. -type CodeContainersClientListOptions struct { - // Continuation token for pagination. - Skip *string -} - // CodeVersion - Azure Resource Manager resource envelope. type CodeVersion struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -1397,16 +1842,20 @@ type CodeVersion struct { // CodeVersionProperties - Code asset version details. type CodeVersionProperties struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // Uri where code is located CodeURI *string // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. @@ -1414,6 +1863,9 @@ type CodeVersionProperties struct { // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string + + // READ-ONLY; Provisioning state for the code version. + ProvisioningState *AssetProvisioningState } // CodeVersionResourceArmPaginatedResult - A paginated list of CodeVersion entities. @@ -1425,29 +1877,20 @@ type CodeVersionResourceArmPaginatedResult struct { Value []*CodeVersion } -// CodeVersionsClientCreateOrUpdateOptions contains the optional parameters for the CodeVersionsClient.CreateOrUpdate method. -type CodeVersionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} +type Collection struct { + // The msi client id used to collect logging to blob storage. If it's null,backend will pick a registered endpoint identity + // to auth. + ClientID *string -// CodeVersionsClientDeleteOptions contains the optional parameters for the CodeVersionsClient.Delete method. -type CodeVersionsClientDeleteOptions struct { - // placeholder for future optional parameters -} + // Enable or disable data collection. + DataCollectionMode *DataCollectionMode -// CodeVersionsClientGetOptions contains the optional parameters for the CodeVersionsClient.Get method. -type CodeVersionsClientGetOptions struct { - // placeholder for future optional parameters -} + // The data asset arm resource id. Client side will ensure data asset is pointing to the blob storage, and backend will collect + // data to the blob storage. + DataID *string -// CodeVersionsClientListOptions contains the optional parameters for the CodeVersionsClient.NewListPager method. -type CodeVersionsClientListOptions struct { - // Ordering of list. - OrderBy *string - // Continuation token for pagination. - Skip *string - // Maximum number of records to return. - Top *int32 + // The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default. + SamplingRate *float64 } // ColumnTransformer - Column transformer parameters. @@ -1470,6 +1913,9 @@ type CommandJob struct { // REQUIRED; [Required] Specifies the type of job. JobType *JobType + // Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + AutologgerSettings *AutologgerSettings + // ARM resource ID of the code asset. CodeID *string @@ -1485,7 +1931,7 @@ type CommandJob struct { // Display name of job. DisplayName *string - // Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + // Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, Ray, or null. Distribution DistributionConfigurationClassification // Environment variables included in the job. @@ -1507,15 +1953,24 @@ type CommandJob struct { // Command Job limit. Limits *CommandJobLimits + // Notification setting for the job + NotificationSetting *NotificationSetting + // Mapping of output data bindings used in the job. Outputs map[string]JobOutputClassification // The asset property dictionary. Properties map[string]*string + // Queue settings for the job + QueueSettings *QueueSettings + // Compute Resource configuration for the job. Resources *JobResourceConfiguration + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. Services map[string]*JobService @@ -1532,18 +1987,20 @@ type CommandJob struct { // GetJobBaseProperties implements the JobBasePropertiesClassification interface for type CommandJob. func (c *CommandJob) GetJobBaseProperties() *JobBaseProperties { return &JobBaseProperties{ - ComponentID: c.ComponentID, - ComputeID: c.ComputeID, - DisplayName: c.DisplayName, - ExperimentName: c.ExperimentName, - Identity: c.Identity, - IsArchived: c.IsArchived, - JobType: c.JobType, - Services: c.Services, - Status: c.Status, - Description: c.Description, - Properties: c.Properties, - Tags: c.Tags, + ComponentID: c.ComponentID, + ComputeID: c.ComputeID, + Description: c.Description, + DisplayName: c.DisplayName, + ExperimentName: c.ExperimentName, + Identity: c.Identity, + IsArchived: c.IsArchived, + JobType: c.JobType, + NotificationSetting: c.NotificationSetting, + Properties: c.Properties, + SecretsConfiguration: c.SecretsConfiguration, + Services: c.Services, + Status: c.Status, + Tags: c.Tags, } } @@ -1565,6 +2022,12 @@ func (c *CommandJobLimits) GetJobLimits() *JobLimits { } } +// ComponentConfiguration - Used for sweep over component +type ComponentConfiguration struct { + // Pipeline settings, for things like ContinueRunOnStepFailure etc. + PipelineSettings any +} + // ComponentContainer - Azure Resource Manager resource envelope. type ComponentContainer struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -1602,6 +2065,9 @@ type ComponentContainerProperties struct { // READ-ONLY; The next auto incremental version NextVersion *string + + // READ-ONLY; Provisioning state for the component container. + ProvisioningState *AssetProvisioningState } // ComponentContainerResourceArmPaginatedResult - A paginated list of ComponentContainer entities. @@ -1613,30 +2079,6 @@ type ComponentContainerResourceArmPaginatedResult struct { Value []*ComponentContainer } -// ComponentContainersClientCreateOrUpdateOptions contains the optional parameters for the ComponentContainersClient.CreateOrUpdate -// method. -type ComponentContainersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ComponentContainersClientDeleteOptions contains the optional parameters for the ComponentContainersClient.Delete method. -type ComponentContainersClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ComponentContainersClientGetOptions contains the optional parameters for the ComponentContainersClient.Get method. -type ComponentContainersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ComponentContainersClientListOptions contains the optional parameters for the ComponentContainersClient.NewListPager method. -type ComponentContainersClientListOptions struct { - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Continuation token for pagination. - Skip *string -} - // ComponentVersion - Azure Resource Manager resource envelope. type ComponentVersion struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -1657,23 +2099,33 @@ type ComponentVersion struct { // ComponentVersionProperties - Definition of a component version: defines resources that span component types. type ComponentVersionProperties struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // Defines Component definition details. ComponentSpec any // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. Properties map[string]*string + // Stage in the component lifecycle + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string + + // READ-ONLY; Provisioning state for the component version. + ProvisioningState *AssetProvisioningState } // ComponentVersionResourceArmPaginatedResult - A paginated list of ComponentVersion entities. @@ -1685,44 +2137,6 @@ type ComponentVersionResourceArmPaginatedResult struct { Value []*ComponentVersion } -// ComponentVersionsClientCreateOrUpdateOptions contains the optional parameters for the ComponentVersionsClient.CreateOrUpdate -// method. -type ComponentVersionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ComponentVersionsClientDeleteOptions contains the optional parameters for the ComponentVersionsClient.Delete method. -type ComponentVersionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ComponentVersionsClientGetOptions contains the optional parameters for the ComponentVersionsClient.Get method. -type ComponentVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ComponentVersionsClientListOptions contains the optional parameters for the ComponentVersionsClient.NewListPager method. -type ComponentVersionsClientListOptions struct { - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Ordering of list. - OrderBy *string - // Continuation token for pagination. - Skip *string - // Maximum number of records to return. - Top *int32 -} - -// ComputeClassification provides polymorphic access to related types. -// Call the interface's GetCompute() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AKS, *AmlCompute, *Compute, *ComputeInstance, *DataFactory, *DataLakeAnalytics, *Databricks, *HDInsight, *Kubernetes, -// - *SynapseSpark, *VirtualMachine -type ComputeClassification interface { - // GetCompute returns the Compute content of the underlying type. - GetCompute() *Compute -} - // Compute - Machine Learning compute object. type Compute struct { // REQUIRED; The type of compute @@ -1760,63 +2174,6 @@ type Compute struct { // GetCompute implements the ComputeClassification interface for type Compute. func (c *Compute) GetCompute() *Compute { return c } -// ComputeClientBeginCreateOrUpdateOptions contains the optional parameters for the ComputeClient.BeginCreateOrUpdate method. -type ComputeClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ComputeClientBeginDeleteOptions contains the optional parameters for the ComputeClient.BeginDelete method. -type ComputeClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ComputeClientBeginRestartOptions contains the optional parameters for the ComputeClient.BeginRestart method. -type ComputeClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ComputeClientBeginStartOptions contains the optional parameters for the ComputeClient.BeginStart method. -type ComputeClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ComputeClientBeginStopOptions contains the optional parameters for the ComputeClient.BeginStop method. -type ComputeClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ComputeClientBeginUpdateOptions contains the optional parameters for the ComputeClient.BeginUpdate method. -type ComputeClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ComputeClientGetOptions contains the optional parameters for the ComputeClient.Get method. -type ComputeClientGetOptions struct { - // placeholder for future optional parameters -} - -// ComputeClientListKeysOptions contains the optional parameters for the ComputeClient.ListKeys method. -type ComputeClientListKeysOptions struct { - // placeholder for future optional parameters -} - -// ComputeClientListNodesOptions contains the optional parameters for the ComputeClient.NewListNodesPager method. -type ComputeClientListNodesOptions struct { - // placeholder for future optional parameters -} - -// ComputeClientListOptions contains the optional parameters for the ComputeClient.NewListPager method. -type ComputeClientListOptions struct { - // Continuation token for pagination. - Skip *string -} - // ComputeInstance - An Azure Machine Learning compute instance. type ComputeInstance struct { // REQUIRED; The type of compute @@ -1857,16 +2214,16 @@ type ComputeInstance struct { // GetCompute implements the ComputeClassification interface for type ComputeInstance. func (c *ComputeInstance) GetCompute() *Compute { return &Compute{ - ComputeType: c.ComputeType, ComputeLocation: c.ComputeLocation, - ProvisioningState: c.ProvisioningState, - Description: c.Description, + ComputeType: c.ComputeType, CreatedOn: c.CreatedOn, + Description: c.Description, + DisableLocalAuth: c.DisableLocalAuth, + IsAttachedCompute: c.IsAttachedCompute, ModifiedOn: c.ModifiedOn, - ResourceID: c.ResourceID, ProvisioningErrors: c.ProvisioningErrors, - IsAttachedCompute: c.IsAttachedCompute, - DisableLocalAuth: c.DisableLocalAuth, + ProvisioningState: c.ProvisioningState, + ResourceID: c.ResourceID, } } @@ -1879,6 +2236,12 @@ type ComputeInstanceApplication struct { EndpointURI *string } +// ComputeInstanceAutologgerSettings - Specifies settings for autologger. +type ComputeInstanceAutologgerSettings struct { + // Indicates whether mlflow autologger is enabled for notebooks. + MlflowAutologger *MlflowAutologger +} + // ComputeInstanceConnectivityEndpoints - Defines all connectivity endpoints and properties for an ComputeInstance. type ComputeInstanceConnectivityEndpoints struct { // READ-ONLY; Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed). @@ -1997,20 +2360,46 @@ type ComputeInstanceProperties struct { // user can access applications on this instance depending on his/her assigned role. ApplicationSharingPolicy *ApplicationSharingPolicy + // Specifies settings for autologger. + AutologgerSettings *ComputeInstanceAutologgerSettings + // The Compute Instance Authorization type. Available values are personal (default). ComputeInstanceAuthorizationType *ComputeInstanceAuthorizationType + // List of Custom Services added to the compute. + CustomServices []*CustomService + // Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that // the compute nodes will have public IPs provisioned. false - Indicates that the // compute nodes will have a private endpoint and no public IPs. EnableNodePublicIP *bool + // Enable Auto OS Patching. Possible values are: true, false. + EnableOSPatching *bool + + // Enable root access. Possible values are: true, false. + EnableRootAccess *bool + + // Enable SSO (single sign on). Possible values are: true, false. + EnableSSO *bool + + // Stops compute instance after user defined period of inactivity. Time is defined in ISO8601 format. Minimum is 15 min, maximum + // is 3 days. + IdleTimeBeforeShutdown *string + // Settings for a personal compute instance. PersonalComputeInstanceSettings *PersonalComputeInstanceSettings + // 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. + ReleaseQuotaOnStop *bool + // Specifies policy and settings for SSH access. SSHSettings *ComputeInstanceSSHSettings + // The list of schedules to be applied on the computes. + Schedules *ComputeSchedules + // Details of customized scripts to execute for setting up the cluster. SetupScripts *SetupScripts @@ -2044,8 +2433,8 @@ type ComputeInstanceProperties struct { // READ-ONLY; The last operation on ComputeInstance. LastOperation *ComputeInstanceLastOperation - // READ-ONLY; The list of schedules to be applied on the computes. - Schedules *ComputeSchedules + // READ-ONLY; Returns metadata about the operating system image for this compute instance. + OSImageMetadata *ImageMetadata // READ-ONLY; The current state of this ComputeInstance. State *ComputeInstanceState @@ -2083,6 +2472,20 @@ type ComputeInstanceVersion struct { Runtime *string } +type ComputeRecurrenceSchedule struct { + // REQUIRED; [Required] List of hours for the schedule. + Hours []*int32 + + // REQUIRED; [Required] List of minutes for the schedule. + Minutes []*int32 + + // List of month days for the schedule + MonthDays []*int32 + + // List of days for the schedule. + WeekDays []*ComputeWeekDay +} + // ComputeResource - Machine Learning compute object wrapped into ARM resource envelope. type ComputeResource struct { // The identity of the resource. @@ -2118,21 +2521,16 @@ type ComputeResourceSchema struct { Properties ComputeClassification } +type ComputeRuntimeDto struct { + SparkRuntimeVersion *string +} + // ComputeSchedules - The list of schedules to be applied on the computes type ComputeSchedules struct { // The list of compute start stop schedules to be applied. ComputeStartStop []*ComputeStartStopSchedule } -// ComputeSecretsClassification provides polymorphic access to related types. -// Call the interface's GetComputeSecrets() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AksComputeSecrets, *ComputeSecrets, *DatabricksComputeSecrets, *VirtualMachineSecrets -type ComputeSecretsClassification interface { - // GetComputeSecrets returns the ComputeSecrets content of the underlying type. - GetComputeSecrets() *ComputeSecrets -} - // ComputeSecrets - Secrets related to a Machine Learning compute. Might differ for every type of compute. type ComputeSecrets struct { // REQUIRED; The type of compute @@ -2148,10 +2546,10 @@ type ComputeStartStopSchedule struct { Action *ComputePowerAction // Required if triggerType is Cron. - Cron *CronTrigger + Cron *Cron // Required if triggerType is Recurrence. - Recurrence *RecurrenceTrigger + Recurrence *Recurrence // [Deprecated] Not used any more. Schedule *ScheduleBase @@ -2160,7 +2558,7 @@ type ComputeStartStopSchedule struct { Status *ScheduleStatus // [Required] The schedule trigger type. - TriggerType *TriggerType + TriggerType *ComputeTriggerType // READ-ONLY; A system assigned id for the schedule. ID *string @@ -2190,10 +2588,37 @@ type ContainerResourceSettings struct { } type CosmosDbSettings struct { - // The throughput of the collections in cosmosdb database CollectionsThroughput *int32 } +type CreateMonitorAction struct { + // REQUIRED; [Required] Specifies the action type of the schedule + ActionType *ScheduleActionType + + // REQUIRED; [Required] Defines the monitor. + MonitorDefinition *MonitorDefinition +} + +// GetScheduleActionBase implements the ScheduleActionBaseClassification interface for type CreateMonitorAction. +func (c *CreateMonitorAction) GetScheduleActionBase() *ScheduleActionBase { + return &ScheduleActionBase{ + ActionType: c.ActionType, + } +} + +// Cron - The workflow trigger cron for ComputeStartStop schedule type. +type Cron struct { + // [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. + Expression *string + + // The start time in yyyy-MM-ddTHH:mm:ss format. + StartTime *string + + // Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: + // https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + TimeZone *string +} + type CronTrigger struct { // REQUIRED; [Required] Specifies cron expression of schedule. The expression should follow NCronTab format. Expression *string @@ -2240,9 +2665,77 @@ func (c *CustomForecastHorizon) GetForecastHorizon() *ForecastHorizon { } } -type CustomModelJobInput struct { - // REQUIRED; [Required] Specifies the type of job. - JobInputType *JobInputType +// CustomInferencingServer - Custom inference server configurations. +type CustomInferencingServer struct { + // REQUIRED; [Required] Inferencing server type for various targets. + ServerType *InferencingServerType + + // Inference configuration for custom inferencing. + InferenceConfiguration *OnlineInferenceConfiguration +} + +// GetInferencingServer implements the InferencingServerClassification interface for type CustomInferencingServer. +func (c *CustomInferencingServer) GetInferencingServer() *InferencingServer { + return &InferencingServer{ + ServerType: c.ServerType, + } +} + +// CustomKeys - Custom Keys credential object +type CustomKeys struct { + // Dictionary of + Keys map[string]*string +} + +// CustomKeysWorkspaceConnectionProperties - Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= +// {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} Use +// Metadata property bag for ApiVersion and other metadata fields +type CustomKeysWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + + // Custom Keys credential object + Credentials *CustomKeys + ExpiryTime *time.Time + + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string + + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type CustomKeysWorkspaceConnectionProperties. +func (c *CustomKeysWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: c.AuthType, + Category: c.Category, + CreatedByWorkspaceArmID: c.CreatedByWorkspaceArmID, + ExpiryTime: c.ExpiryTime, + IsSharedToAll: c.IsSharedToAll, + Metadata: c.Metadata, + Target: c.Target, + } +} + +type CustomMetricThreshold struct { + // REQUIRED; [Required] The user-defined metric to calculate. + Metric *string + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +type CustomModelJobInput struct { + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType // REQUIRED; [Required] Input Asset URI. URI *string @@ -2266,6 +2759,15 @@ type CustomModelJobOutput struct { // REQUIRED; [Required] Specifies the type of job. JobOutputType *JobOutputType + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Description for the output. Description *string @@ -2284,6 +2786,41 @@ func (c *CustomModelJobOutput) GetJobOutput() *JobOutput { } } +type CustomMonitoringSignal struct { + // REQUIRED; [Required] ARM resource ID of the component resource used to calculate the custom metrics. + ComponentID *string + + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThresholds []*CustomMetricThreshold + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // Monitoring assets to take as input. Key is the component input port name, value is the data asset. + InputAssets map[string]MonitoringInputDataBaseClassification + + // Extra component parameters to take as input. Key is the component literal input port name, value is the parameter value. + Inputs map[string]JobInputClassification + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string + + // A list of metrics to calculate and their associated thresholds. + WorkspaceConnection *MonitoringWorkspaceConnection +} + +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type CustomMonitoringSignal. +func (c *CustomMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: c.NotificationTypes, + Properties: c.Properties, + SignalType: c.SignalType, + } +} + // CustomNCrossValidations - N-Cross validations are specified by user. type CustomNCrossValidations struct { // REQUIRED; [Required] Mode for determining N-Cross validations. @@ -2315,6 +2852,33 @@ func (c *CustomSeasonality) GetSeasonality() *Seasonality { } } +// CustomService - Specifies the custom service configuration +type CustomService struct { + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any + + // Describes the docker settings for the image + Docker *Docker + + // Configuring the endpoints for the container + Endpoints []*Endpoint + + // Environment Variable for the container + EnvironmentVariables map[string]*EnvironmentVariable + + // Describes the Image Specifications + Image *Image + + // Describes the jupyter kernel settings for the image if its a custom environment + Kernel *JupyterKernelConfig + + // Name of the Custom Service + Name *string + + // Configuring the volumes for the container + Volumes []*VolumeDefinition +} + type CustomTargetLags struct { // REQUIRED; [Required] Set target lags mode - Auto/Custom Mode *TargetLagsMode @@ -2345,6 +2909,24 @@ func (c *CustomTargetRollingWindowSize) GetTargetRollingWindowSize() *TargetRoll } } +type DataCollector struct { + // REQUIRED; [Required] The collection configuration. Each collection has it own configuration to collect model data and the + // name of collection can be arbitrary string. Model data collector can be used for either + // payload logging or custom logging or both of them. Collection request and response are reserved for payload logging, others + // are for custom logging. + Collections map[string]*Collection + + // The request logging configuration for mdc, it includes advanced logging settings for all collections. It's optional. + RequestLogging *RequestLogging + + // When model data is collected to blob storage, we need to roll the data to different path to avoid logging all of them in + // a single blob file. If the rolling rate is hour, all data will be collected in + // the blob path /yyyy/MM/dd/HH/. If it's day, all data will be collected in blob path /yyyy/MM/dd/. The other benefit of + // rolling path is that model monitoring ui is able to select a time range of data + // very quickly. + RollingRate *RollingRateType +} + // DataContainer - Azure Resource Manager resource envelope. type DataContainer struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -2396,28 +2978,58 @@ type DataContainerResourceArmPaginatedResult struct { Value []*DataContainer } -// DataContainersClientCreateOrUpdateOptions contains the optional parameters for the DataContainersClient.CreateOrUpdate -// method. -type DataContainersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +type DataDriftMetricThresholdBase struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold } -// DataContainersClientDeleteOptions contains the optional parameters for the DataContainersClient.Delete method. -type DataContainersClientDeleteOptions struct { - // placeholder for future optional parameters +// GetDataDriftMetricThresholdBase implements the DataDriftMetricThresholdBaseClassification interface for type DataDriftMetricThresholdBase. +func (d *DataDriftMetricThresholdBase) GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase { + return d } -// DataContainersClientGetOptions contains the optional parameters for the DataContainersClient.Get method. -type DataContainersClientGetOptions struct { - // placeholder for future optional parameters +type DataDriftMonitoringSignal struct { + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThresholds []DataDriftMetricThresholdBaseClassification + + // REQUIRED; [Required] The data which drift will be calculated for. + ProductionData MonitoringInputDataBaseClassification + + // REQUIRED; [Required] The data to calculate drift against. + ReferenceData MonitoringInputDataBaseClassification + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // The data segment used for scoping on a subset of the data population. + DataSegment *MonitoringDataSegment + + // A dictionary that maps feature names to their respective data types. + FeatureDataTypeOverride map[string]*MonitoringFeatureDataType + + // The settings for computing feature importance. + FeatureImportanceSettings *FeatureImportanceSettings + + // The feature filter which identifies which feature to calculate drift over. + Features MonitoringFeatureFilterBaseClassification + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string } -// DataContainersClientListOptions contains the optional parameters for the DataContainersClient.NewListPager method. -type DataContainersClientListOptions struct { - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Continuation token for pagination. - Skip *string +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type DataDriftMonitoringSignal. +func (d *DataDriftMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: d.NotificationTypes, + Properties: d.Properties, + SignalType: d.SignalType, + } } // DataFactory - A DataFactory compute. @@ -2457,19 +3069,85 @@ type DataFactory struct { // GetCompute implements the ComputeClassification interface for type DataFactory. func (d *DataFactory) GetCompute() *Compute { return &Compute{ - ComputeType: d.ComputeType, ComputeLocation: d.ComputeLocation, - ProvisioningState: d.ProvisioningState, - Description: d.Description, + ComputeType: d.ComputeType, CreatedOn: d.CreatedOn, + Description: d.Description, + DisableLocalAuth: d.DisableLocalAuth, + IsAttachedCompute: d.IsAttachedCompute, ModifiedOn: d.ModifiedOn, - ResourceID: d.ResourceID, ProvisioningErrors: d.ProvisioningErrors, - IsAttachedCompute: d.IsAttachedCompute, - DisableLocalAuth: d.DisableLocalAuth, + ProvisioningState: d.ProvisioningState, + ResourceID: d.ResourceID, + } +} + +type DataImport struct { + // REQUIRED; [Required] Specifies the type of data. + DataType *DataType + + // REQUIRED; [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 + DataURI *string + + // Name of the asset for data import job to create + AssetName *string + + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + + // The asset description text. + Description *string + + // Intellectual Property details. Used if data is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 + IsAnonymous *bool + + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived + IsArchived *bool + + // The asset property dictionary. + Properties map[string]*string + + // Source data of the asset to import from + Source DataImportSourceClassification + + // Stage in the data lifecycle assigned to this data asset + Stage *string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string +} + +// GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type DataImport. +func (d *DataImport) GetDataVersionBaseProperties() *DataVersionBaseProperties { + return &DataVersionBaseProperties{ + AutoDeleteSetting: d.AutoDeleteSetting, + DataType: d.DataType, + DataURI: d.DataURI, + Description: d.Description, + IntellectualProperty: d.IntellectualProperty, + IsAnonymous: d.IsAnonymous, + IsArchived: d.IsArchived, + Properties: d.Properties, + Stage: d.Stage, + Tags: d.Tags, } } +type DataImportSource struct { + // REQUIRED; [Required] Specifies the type of data. + SourceType *DataImportSourceType + + // Workspace connection for data import source storage + Connection *string +} + +// GetDataImportSource implements the DataImportSourceClassification interface for type DataImportSource. +func (d *DataImportSource) GetDataImportSource() *DataImportSource { return d } + // DataLakeAnalytics - A DataLakeAnalytics compute. type DataLakeAnalytics struct { // REQUIRED; The type of compute @@ -2508,16 +3186,16 @@ type DataLakeAnalytics struct { // GetCompute implements the ComputeClassification interface for type DataLakeAnalytics. func (d *DataLakeAnalytics) GetCompute() *Compute { return &Compute{ - ComputeType: d.ComputeType, ComputeLocation: d.ComputeLocation, - ProvisioningState: d.ProvisioningState, - Description: d.Description, + ComputeType: d.ComputeType, CreatedOn: d.CreatedOn, + Description: d.Description, + DisableLocalAuth: d.DisableLocalAuth, + IsAttachedCompute: d.IsAttachedCompute, ModifiedOn: d.ModifiedOn, - ResourceID: d.ResourceID, ProvisioningErrors: d.ProvisioningErrors, - IsAttachedCompute: d.IsAttachedCompute, - DisableLocalAuth: d.DisableLocalAuth, + ProvisioningState: d.ProvisioningState, + ResourceID: d.ResourceID, } } @@ -2549,6 +3227,66 @@ func (d *DataPathAssetReference) GetAssetReferenceBase() *AssetReferenceBase { } } +type DataQualityMetricThresholdBase struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetDataQualityMetricThresholdBase implements the DataQualityMetricThresholdBaseClassification interface for type DataQualityMetricThresholdBase. +func (d *DataQualityMetricThresholdBase) GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase { + return d +} + +type DataQualityMonitoringSignal struct { + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThresholds []DataQualityMetricThresholdBaseClassification + + // REQUIRED; [Required] The data produced by the production service which drift will be calculated for. + ProductionData MonitoringInputDataBaseClassification + + // REQUIRED; [Required] The data to calculate drift against. + ReferenceData MonitoringInputDataBaseClassification + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // A dictionary that maps feature names to their respective data types. + FeatureDataTypeOverride map[string]*MonitoringFeatureDataType + + // The settings for computing feature importance. + FeatureImportanceSettings *FeatureImportanceSettings + + // The features to calculate drift over. + Features MonitoringFeatureFilterBaseClassification + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string +} + +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type DataQualityMonitoringSignal. +func (d *DataQualityMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: d.NotificationTypes, + Properties: d.Properties, + SignalType: d.SignalType, + } +} + +// DataReferenceCredential base class +type DataReferenceCredential struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *DataReferenceCredentialType +} + +// GetDataReferenceCredential implements the DataReferenceCredentialClassification interface for type DataReferenceCredential. +func (d *DataReferenceCredential) GetDataReferenceCredential() *DataReferenceCredential { return d } + // DataVersionBase - Azure Resource Manager resource envelope. type DataVersionBase struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -2567,35 +3305,36 @@ type DataVersionBase struct { Type *string } -// DataVersionBasePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetDataVersionBaseProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DataVersionBaseProperties, *MLTableData, *URIFileDataVersion, *URIFolderDataVersion -type DataVersionBasePropertiesClassification interface { - // GetDataVersionBaseProperties returns the DataVersionBaseProperties content of the underlying type. - GetDataVersionBaseProperties() *DataVersionBaseProperties -} - // DataVersionBaseProperties - Data version base definition type DataVersionBaseProperties struct { // REQUIRED; [Required] Specifies the type of data. DataType *DataType - // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType + // REQUIRED; [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 DataURI *string + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // Intellectual Property details. Used if data is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. Properties map[string]*string + // Stage in the data lifecycle assigned to this data asset + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string } @@ -2614,35 +3353,32 @@ type DataVersionBaseResourceArmPaginatedResult struct { Value []*DataVersionBase } -// DataVersionsClientCreateOrUpdateOptions contains the optional parameters for the DataVersionsClient.CreateOrUpdate method. -type DataVersionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} +type DatabaseSource struct { + // REQUIRED; [Required] Specifies the type of data. + SourceType *DataImportSourceType -// DataVersionsClientDeleteOptions contains the optional parameters for the DataVersionsClient.Delete method. -type DataVersionsClientDeleteOptions struct { - // placeholder for future optional parameters -} + // Workspace connection for data import source storage + Connection *string -// DataVersionsClientGetOptions contains the optional parameters for the DataVersionsClient.Get method. -type DataVersionsClientGetOptions struct { - // placeholder for future optional parameters + // SQL Query statement for data import Database source + Query *string + + // SQL StoredProcedure on data import Database source + StoredProcedure *string + + // SQL StoredProcedure parameters + StoredProcedureParams []map[string]*string + + // Name of the table on data import Database source + TableName *string } -// DataVersionsClientListOptions contains the optional parameters for the DataVersionsClient.NewListPager method. -type DataVersionsClientListOptions struct { - // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived - // entities. - ListViewType *ListViewType - // Please choose OrderBy value from ['createdtime', 'modifiedtime'] - OrderBy *string - // Continuation token for pagination. - Skip *string - // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 - Tags *string - // 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 - Top *int32 +// GetDataImportSource implements the DataImportSourceClassification interface for type DatabaseSource. +func (d *DatabaseSource) GetDataImportSource() *DataImportSource { + return &DataImportSource{ + Connection: d.Connection, + SourceType: d.SourceType, + } } // Databricks - A DataFactory compute. @@ -2685,16 +3421,16 @@ type Databricks struct { // GetCompute implements the ComputeClassification interface for type Databricks. func (d *Databricks) GetCompute() *Compute { return &Compute{ - ComputeType: d.ComputeType, ComputeLocation: d.ComputeLocation, - ProvisioningState: d.ProvisioningState, - Description: d.Description, + ComputeType: d.ComputeType, CreatedOn: d.CreatedOn, + Description: d.Description, + DisableLocalAuth: d.DisableLocalAuth, + IsAttachedCompute: d.IsAttachedCompute, ModifiedOn: d.ModifiedOn, - ResourceID: d.ResourceID, ProvisioningErrors: d.ProvisioningErrors, - IsAttachedCompute: d.IsAttachedCompute, - DisableLocalAuth: d.DisableLocalAuth, + ProvisioningState: d.ProvisioningState, + ResourceID: d.ResourceID, } } @@ -2734,6 +3470,37 @@ type DatabricksSchema struct { Properties *DatabricksProperties } +type DatasetExportSummary struct { + // REQUIRED; [Required] The format of exported labels, also as the discriminator. + Format *ExportFormatType + + // READ-ONLY; The time when the export was completed. + EndDateTime *time.Time + + // READ-ONLY; The total number of labeled datapoints exported. + ExportedRowCount *int64 + + // READ-ONLY; The unique name of the labeled data asset. + LabeledAssetName *string + + // READ-ONLY; Name and identifier of the job containing exported labels. + LabelingJobID *string + + // READ-ONLY; The time when the export was requested. + StartDateTime *time.Time +} + +// GetExportSummary implements the ExportSummaryClassification interface for type DatasetExportSummary. +func (d *DatasetExportSummary) GetExportSummary() *ExportSummary { + return &ExportSummary{ + EndDateTime: d.EndDateTime, + ExportedRowCount: d.ExportedRowCount, + Format: d.Format, + LabelingJobID: d.LabelingJobID, + StartDateTime: d.StartDateTime, + } +} + // Datastore - Azure Resource Manager resource envelope. type Datastore struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -2752,16 +3519,6 @@ type Datastore struct { Type *string } -// DatastoreCredentialsClassification provides polymorphic access to related types. -// Call the interface's GetDatastoreCredentials() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AccountKeyDatastoreCredentials, *CertificateDatastoreCredentials, *DatastoreCredentials, *NoneDatastoreCredentials, -// - *SasDatastoreCredentials, *ServicePrincipalDatastoreCredentials -type DatastoreCredentialsClassification interface { - // GetDatastoreCredentials returns the DatastoreCredentials content of the underlying type. - GetDatastoreCredentials() *DatastoreCredentials -} - // DatastoreCredentials - Base definition for datastore credentials. type DatastoreCredentials struct { // REQUIRED; [Required] Credential type used to authentication with storage. @@ -2771,15 +3528,6 @@ type DatastoreCredentials struct { // GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type DatastoreCredentials. func (d *DatastoreCredentials) GetDatastoreCredentials() *DatastoreCredentials { return d } -// DatastorePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetDatastoreProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureBlobDatastore, *AzureDataLakeGen1Datastore, *AzureDataLakeGen2Datastore, *AzureFileDatastore, *DatastoreProperties -type DatastorePropertiesClassification interface { - // GetDatastoreProperties returns the DatastoreProperties content of the underlying type. - GetDatastoreProperties() *DatastoreProperties -} - // DatastoreProperties - Base definition for datastore contents configuration. type DatastoreProperties struct { // REQUIRED; [Required] Account credentials. @@ -2791,6 +3539,9 @@ type DatastoreProperties struct { // The asset description text. Description *string + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + // The asset property dictionary. Properties map[string]*string @@ -2813,15 +3564,6 @@ type DatastoreResourceArmPaginatedResult struct { Value []*Datastore } -// DatastoreSecretsClassification provides polymorphic access to related types. -// Call the interface's GetDatastoreSecrets() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AccountKeyDatastoreSecrets, *CertificateDatastoreSecrets, *DatastoreSecrets, *SasDatastoreSecrets, *ServicePrincipalDatastoreSecrets -type DatastoreSecretsClassification interface { - // GetDatastoreSecrets returns the DatastoreSecrets content of the underlying type. - GetDatastoreSecrets() *DatastoreSecrets -} - // DatastoreSecrets - Base definition for datastore secrets. type DatastoreSecrets struct { // REQUIRED; [Required] Credential type used to authentication with storage. @@ -2831,45 +3573,6 @@ type DatastoreSecrets struct { // GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type DatastoreSecrets. func (d *DatastoreSecrets) GetDatastoreSecrets() *DatastoreSecrets { return d } -// DatastoresClientCreateOrUpdateOptions contains the optional parameters for the DatastoresClient.CreateOrUpdate method. -type DatastoresClientCreateOrUpdateOptions struct { - // Flag to skip validation. - SkipValidation *bool -} - -// DatastoresClientDeleteOptions contains the optional parameters for the DatastoresClient.Delete method. -type DatastoresClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DatastoresClientGetOptions contains the optional parameters for the DatastoresClient.Get method. -type DatastoresClientGetOptions struct { - // placeholder for future optional parameters -} - -// DatastoresClientListOptions contains the optional parameters for the DatastoresClient.NewListPager method. -type DatastoresClientListOptions struct { - // Maximum number of results to return. - Count *int32 - // Filter down to the workspace default datastore. - IsDefault *bool - // Names of datastores to return. - Names []string - // Order by property (createdtime | modifiedtime | name). - OrderBy *string - // Order by property in ascending order. - OrderByAsc *bool - // Text to search for in the datastore names. - SearchText *string - // Continuation token for pagination. - Skip *string -} - -// DatastoresClientListSecretsOptions contains the optional parameters for the DatastoresClient.ListSecrets method. -type DatastoresClientListSecretsOptions struct { - // placeholder for future optional parameters -} - type DefaultScaleSettings struct { // REQUIRED; [Required] Type of deployment scaling algorithm ScaleType *ScaleType @@ -2902,10 +3605,29 @@ type DeploymentResourceConfiguration struct { // Optional type of VM used as supported by the compute target. InstanceType *string + // Locations where the job can run. + Locations []*string + + // 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. + MaxInstanceCount *int32 + // Additional properties bag. Properties map[string]any } +// DestinationAsset - Publishing destination registry asset information +type DestinationAsset struct { + // Destination asset name + DestinationName *string + + // Destination asset version + DestinationVersion *string + + // Destination registry name + RegistryName *string +} + type DiagnoseRequestProperties struct { // Setting for diagnosing dependent application insights ApplicationInsights map[string]any @@ -2925,6 +3647,9 @@ type DiagnoseRequestProperties struct { // Setting for diagnosing unclassified category of problems Others map[string]any + // Setting for diagnosing the presence of required resource providers in the workspace. + RequiredResourceProviders map[string]any + // Setting for diagnosing resource lock ResourceLock map[string]any @@ -2965,19 +3690,9 @@ type DiagnoseResult struct { // DiagnoseWorkspaceParameters - Parameters to diagnose a workspace type DiagnoseWorkspaceParameters struct { - // Value of Parameters Value *DiagnoseRequestProperties } -// DistributionConfigurationClassification provides polymorphic access to related types. -// Call the interface's GetDistributionConfiguration() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DistributionConfiguration, *Mpi, *PyTorch, *TensorFlow -type DistributionConfigurationClassification interface { - // GetDistributionConfiguration returns the DistributionConfiguration content of the underlying type. - GetDistributionConfiguration() *DistributionConfiguration -} - // DistributionConfiguration - Base definition for job distribution configuration. type DistributionConfiguration struct { // REQUIRED; [Required] Specifies the type of distribution framework. @@ -2989,13 +3704,31 @@ func (d *DistributionConfiguration) GetDistributionConfiguration() *Distribution return d } -// EarlyTerminationPolicyClassification provides polymorphic access to related types. -// Call the interface's GetEarlyTerminationPolicy() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *BanditPolicy, *EarlyTerminationPolicy, *MedianStoppingPolicy, *TruncationSelectionPolicy -type EarlyTerminationPolicyClassification interface { - // GetEarlyTerminationPolicy returns the EarlyTerminationPolicy content of the underlying type. - GetEarlyTerminationPolicy() *EarlyTerminationPolicy +type Docker struct { + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any + + // Indicate whether container shall run in privileged or non-privileged mode. + Privileged *bool +} + +// DockerCredential - Credential for docker with username and password +type DockerCredential struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *DataReferenceCredentialType + + // DockerCredential user password + Password *string + + // DockerCredential user name + UserName *string +} + +// GetDataReferenceCredential implements the DataReferenceCredentialClassification interface for type DockerCredential. +func (d *DockerCredential) GetDataReferenceCredential() *DataReferenceCredential { + return &DataReferenceCredential{ + CredentialType: d.CredentialType, + } } // EarlyTerminationPolicy - Early termination policies enable canceling poor-performing runs before they complete @@ -3013,26 +3746,51 @@ type EarlyTerminationPolicy struct { // GetEarlyTerminationPolicy implements the EarlyTerminationPolicyClassification interface for type EarlyTerminationPolicy. func (e *EarlyTerminationPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPolicy { return e } -type EncryptionKeyVaultProperties struct { - // REQUIRED; Key vault uri to access the encryption key. +type EncryptionKeyVaultUpdateProperties struct { + // REQUIRED KeyIdentifier *string - - // REQUIRED; The ArmId of the keyVault where the customer owned encryption key is present. - KeyVaultArmID *string - - // For future use - The client id of the identity which will be used to access key vault. - IdentityClientID *string } type EncryptionProperty struct { - // REQUIRED; Customer Key vault properties. - KeyVaultProperties *EncryptionKeyVaultProperties + // REQUIRED; KeyVault details to do the encryption + KeyVaultProperties *KeyVaultProperties // REQUIRED; Indicates whether or not the encryption is enabled for the workspace. Status *EncryptionStatus - // The identity that will be used to access the key vault for encryption at rest. + // The byok cosmosdb account that customer brings to store customer's data with encryption + CosmosDbResourceID *string + + // Identity to be used with the keyVault Identity *IdentityForCmk + + // The byok search account that customer brings to store customer's data with encryption + SearchAccountResourceID *string + + // The byok storage account that customer brings to store customer's data with encryption + StorageAccountResourceID *string +} + +type EncryptionUpdateProperties struct { + // REQUIRED + KeyVaultProperties *EncryptionKeyVaultUpdateProperties +} + +type Endpoint struct { + // Host IP over which the application is exposed from the container + HostIP *string + + // Name of the Endpoint + Name *string + + // Protocol over which communication will happen over this endpoint + Protocol *Protocol + + // Port over which the application is exposed from container. + Published *int32 + + // Application port inside the container. + Target *int32 } // EndpointAuthKeys - Keys for endpoint authentication. @@ -3067,7 +3825,7 @@ type EndpointDeploymentPropertiesBase struct { // Description of the endpoint deployment. Description *string - // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + // ARM resource ID of the environment specification for the endpoint deployment. EnvironmentID *string // Environment variables configuration for the deployment. @@ -3152,6 +3910,9 @@ type EnvironmentContainerProperties struct { // READ-ONLY; The next auto incremental version NextVersion *string + + // READ-ONLY; Provisioning state for the environment container. + ProvisioningState *AssetProvisioningState } // EnvironmentContainerResourceArmPaginatedResult - A paginated list of EnvironmentContainer entities. @@ -3163,29 +3924,15 @@ type EnvironmentContainerResourceArmPaginatedResult struct { Value []*EnvironmentContainer } -// EnvironmentContainersClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentContainersClient.CreateOrUpdate -// method. -type EnvironmentContainersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} +type EnvironmentVariable struct { + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any -// EnvironmentContainersClientDeleteOptions contains the optional parameters for the EnvironmentContainersClient.Delete method. -type EnvironmentContainersClientDeleteOptions struct { - // placeholder for future optional parameters -} + // Type of the Environment Variable. Possible values are: local - For local variable + Type *EnvironmentVariableType -// EnvironmentContainersClientGetOptions contains the optional parameters for the EnvironmentContainersClient.Get method. -type EnvironmentContainersClientGetOptions struct { - // placeholder for future optional parameters -} - -// EnvironmentContainersClientListOptions contains the optional parameters for the EnvironmentContainersClient.NewListPager -// method. -type EnvironmentContainersClientListOptions struct { - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Continuation token for pagination. - Skip *string + // Value of the Environment variable + Value *string } // EnvironmentVersion - Azure Resource Manager resource envelope. @@ -3208,6 +3955,9 @@ type EnvironmentVersion struct { // EnvironmentVersionProperties - Environment version details. type EnvironmentVersionProperties struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // Defines if image needs to be rebuilt based on base image changes. AutoRebuild *AutoRebuildSetting @@ -3226,10 +3976,14 @@ type EnvironmentVersionProperties struct { // Defines configuration specific to inference. InferenceConfig *InferenceContainerProperties - // If the name version are system generated (anonymous registration). + // Intellectual Property details. Used if environment is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The OS type of the environment. @@ -3238,11 +3992,17 @@ type EnvironmentVersionProperties struct { // The asset property dictionary. Properties map[string]*string + // Stage in the environment lifecycle assigned to this environment + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string // READ-ONLY; Environment type is either user managed or curated by the Azure ML service EnvironmentType *EnvironmentType + + // READ-ONLY; Provisioning state for the environment version. + ProvisioningState *AssetProvisioningState } // EnvironmentVersionResourceArmPaginatedResult - A paginated list of EnvironmentVersion entities. @@ -3254,34 +4014,6 @@ type EnvironmentVersionResourceArmPaginatedResult struct { Value []*EnvironmentVersion } -// EnvironmentVersionsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentVersionsClient.CreateOrUpdate -// method. -type EnvironmentVersionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// EnvironmentVersionsClientDeleteOptions contains the optional parameters for the EnvironmentVersionsClient.Delete method. -type EnvironmentVersionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// EnvironmentVersionsClientGetOptions contains the optional parameters for the EnvironmentVersionsClient.Get method. -type EnvironmentVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// EnvironmentVersionsClientListOptions contains the optional parameters for the EnvironmentVersionsClient.NewListPager method. -type EnvironmentVersionsClientListOptions struct { - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Ordering of list. - OrderBy *string - // Continuation token for pagination. - Skip *string - // Maximum number of records to return. - Top *int32 -} - // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -3340,8 +4072,28 @@ type EstimatedVMPrices struct { Values []*EstimatedVMPrice } +type ExportSummary struct { + // REQUIRED; [Required] The format of exported labels, also as the discriminator. + Format *ExportFormatType + + // READ-ONLY; The time when the export was completed. + EndDateTime *time.Time + + // READ-ONLY; The total number of labeled datapoints exported. + ExportedRowCount *int64 + + // READ-ONLY; Name and identifier of the job containing exported labels. + LabelingJobID *string + + // READ-ONLY; The time when the export was requested. + StartDateTime *time.Time +} + +// GetExportSummary implements the ExportSummaryClassification interface for type ExportSummary. +func (e *ExportSummary) GetExportSummary() *ExportSummary { return e } + type ExternalFQDNResponse struct { - Value []*FQDNEndpoints + Value []*FQDNEndpointsPropertyBag } type FQDNEndpoint struct { @@ -3354,34 +4106,466 @@ type FQDNEndpointDetail struct { } type FQDNEndpoints struct { - Properties *FQDNEndpointsProperties -} - -type FQDNEndpointsProperties struct { Category *string Endpoints []*FQDNEndpoint } +// FQDNEndpointsPropertyBag - Property bag for FQDN endpoints result +type FQDNEndpointsPropertyBag struct { + Properties *FQDNEndpoints +} + +// Feature - Azure Resource Manager resource envelope. +type Feature struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *FeatureProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type FeatureAttributionDriftMonitoringSignal struct { + // REQUIRED; [Required] The settings for computing feature importance. + FeatureImportanceSettings *FeatureImportanceSettings + + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThreshold *FeatureAttributionMetricThreshold + + // REQUIRED; [Required] The data which drift will be calculated for. + ProductionData []MonitoringInputDataBaseClassification + + // REQUIRED; [Required] The data to calculate drift against. + ReferenceData MonitoringInputDataBaseClassification + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // A dictionary that maps feature names to their respective data types. + FeatureDataTypeOverride map[string]*MonitoringFeatureDataType + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string +} + +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type FeatureAttributionDriftMonitoringSignal. +func (f *FeatureAttributionDriftMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: f.NotificationTypes, + Properties: f.Properties, + SignalType: f.SignalType, + } +} + +type FeatureAttributionMetricThreshold struct { + // REQUIRED; [Required] The feature attribution metric to calculate. + Metric *FeatureAttributionMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +type FeatureImportanceSettings struct { + // The mode of operation for computing feature importance. + Mode *FeatureImportanceMode + + // The name of the target column within the input data asset. + TargetColumn *string +} + +// FeatureProperties - Dto object representing feature +type FeatureProperties struct { + // Specifies type + DataType *FeatureDataType + + // The asset description text. + Description *string + + // Specifies name + FeatureName *string + + // The asset property dictionary. + Properties map[string]*string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string +} + +// FeatureResourceArmPaginatedResult - A paginated list of Feature entities. +type FeatureResourceArmPaginatedResult struct { + // The link to the next page of Feature objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type Feature. + Value []*Feature +} + +type FeatureStoreSettings struct { + ComputeRuntime *ComputeRuntimeDto + OfflineStoreConnectionName *string + OnlineStoreConnectionName *string +} + +type FeatureSubset struct { + // REQUIRED; [Required] The list of features to include. + Features []*string + + // REQUIRED; [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + FilterType *MonitoringFeatureFilterType +} + +// GetMonitoringFeatureFilterBase implements the MonitoringFeatureFilterBaseClassification interface for type FeatureSubset. +func (f *FeatureSubset) GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase { + return &MonitoringFeatureFilterBase{ + FilterType: f.FilterType, + } +} + +// FeatureWindow - Specifies the feature window +type FeatureWindow struct { + // Specifies the feature window end time + FeatureWindowEnd *time.Time + + // Specifies the feature window start time + FeatureWindowStart *time.Time +} + +// FeaturesetContainer - Azure Resource Manager resource envelope. +type FeaturesetContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *FeaturesetContainerProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FeaturesetContainerProperties - Dto object representing feature set +type FeaturesetContainerProperties struct { + // The asset description text. + Description *string + + // Is the asset archived? + IsArchived *bool + + // The asset property dictionary. + Properties map[string]*string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; The latest version inside this container. + LatestVersion *string + + // READ-ONLY; The next auto incremental version + NextVersion *string + + // READ-ONLY; Provisioning state for the featureset container. + ProvisioningState *AssetProvisioningState +} + +// FeaturesetContainerResourceArmPaginatedResult - A paginated list of FeaturesetContainer entities. +type FeaturesetContainerResourceArmPaginatedResult struct { + // The link to the next page of FeaturesetContainer objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type FeaturesetContainer. + Value []*FeaturesetContainer +} + +// FeaturesetSpecification - Dto object representing specification +type FeaturesetSpecification struct { + // Specifies the spec path + Path *string +} + +// FeaturesetVersion - Azure Resource Manager resource envelope. +type FeaturesetVersion struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *FeaturesetVersionProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FeaturesetVersionBackfillRequest - Request payload for creating a backfill request for a given feature set version +type FeaturesetVersionBackfillRequest struct { + // Specified the data availability status that you want to backfill + DataAvailabilityStatus []*DataAvailabilityStatus + + // Specifies description + Description *string + + // Specifies description + DisplayName *string + + // Specifies the backfill feature window to be materialized + FeatureWindow *FeatureWindow + + // Specify the jobId to retry the failed materialization + JobID *string + + // Specifies the properties + Properties map[string]*string + + // Specifies the compute resource settings + Resource *MaterializationComputeResource + + // Specifies the spark compute settings + SparkConfiguration map[string]*string + + // Specifies the tags + Tags map[string]*string +} + +// FeaturesetVersionBackfillResponse - Response payload for creating a backfill request for a given feature set version +type FeaturesetVersionBackfillResponse struct { + // List of jobs submitted as part of the backfill request. + JobIDs []*string +} + +// FeaturesetVersionProperties - Dto object representing feature set version +type FeaturesetVersionProperties struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + + // The asset description text. + Description *string + + // Specifies list of entities + Entities []*string + + // 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 + IsAnonymous *bool + + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived + IsArchived *bool + + // Specifies the materialization settings + MaterializationSettings *MaterializationSettings + + // The asset property dictionary. + Properties map[string]*string + + // Specifies the feature spec details + Specification *FeaturesetSpecification + + // Specifies the asset stage + Stage *string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Provisioning state for the featureset version container. + ProvisioningState *AssetProvisioningState +} + +// FeaturesetVersionResourceArmPaginatedResult - A paginated list of FeaturesetVersion entities. +type FeaturesetVersionResourceArmPaginatedResult struct { + // The link to the next page of FeaturesetVersion objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type FeaturesetVersion. + Value []*FeaturesetVersion +} + +// FeaturestoreEntityContainer - Azure Resource Manager resource envelope. +type FeaturestoreEntityContainer struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *FeaturestoreEntityContainerProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FeaturestoreEntityContainerProperties - Dto object representing feature entity +type FeaturestoreEntityContainerProperties struct { + // The asset description text. + Description *string + + // Is the asset archived? + IsArchived *bool + + // The asset property dictionary. + Properties map[string]*string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; The latest version inside this container. + LatestVersion *string + + // READ-ONLY; The next auto incremental version + NextVersion *string + + // READ-ONLY; Provisioning state for the featurestore entity container. + ProvisioningState *AssetProvisioningState +} + +// FeaturestoreEntityContainerResourceArmPaginatedResult - A paginated list of FeaturestoreEntityContainer entities. +type FeaturestoreEntityContainerResourceArmPaginatedResult struct { + // The link to the next page of FeaturestoreEntityContainer objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type FeaturestoreEntityContainer. + Value []*FeaturestoreEntityContainer +} + +// FeaturestoreEntityVersion - Azure Resource Manager resource envelope. +type FeaturestoreEntityVersion struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *FeaturestoreEntityVersionProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FeaturestoreEntityVersionProperties - Dto object representing feature entity version +type FeaturestoreEntityVersionProperties struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + + // The asset description text. + Description *string + + // Specifies index columns + IndexColumns []*IndexColumn + + // 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 + IsAnonymous *bool + + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived + IsArchived *bool + + // The asset property dictionary. + Properties map[string]*string + + // Specifies the asset stage + Stage *string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Provisioning state for the featurestore entity version. + ProvisioningState *AssetProvisioningState +} + +// FeaturestoreEntityVersionResourceArmPaginatedResult - A paginated list of FeaturestoreEntityVersion entities. +type FeaturestoreEntityVersionResourceArmPaginatedResult struct { + // The link to the next page of FeaturestoreEntityVersion objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type FeaturestoreEntityVersion. + Value []*FeaturestoreEntityVersion +} + // FeaturizationSettings - Featurization Configuration. type FeaturizationSettings struct { // Dataset language, useful for the text data. DatasetLanguage *string } +type FileSystemSource struct { + // REQUIRED; [Required] Specifies the type of data. + SourceType *DataImportSourceType + + // Workspace connection for data import source storage + Connection *string + + // Path on data import FileSystem source + Path *string +} + +// GetDataImportSource implements the DataImportSourceClassification interface for type FileSystemSource. +func (f *FileSystemSource) GetDataImportSource() *DataImportSource { + return &DataImportSource{ + Connection: f.Connection, + SourceType: f.SourceType, + } +} + +// FixedInputData - Fixed input data definition. +type FixedInputData struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + InputDataType *MonitoringInputDataType + + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType + + // REQUIRED; [Required] Input Asset URI. + URI *string + + // Mapping of column names to special uses. + Columns map[string]*string + + // The context metadata of the data source. + DataContext *string +} + +// GetMonitoringInputDataBase implements the MonitoringInputDataBaseClassification interface for type FixedInputData. +func (f *FixedInputData) GetMonitoringInputDataBase() *MonitoringInputDataBase { + return &MonitoringInputDataBase{ + Columns: f.Columns, + DataContext: f.DataContext, + InputDataType: f.InputDataType, + JobInputType: f.JobInputType, + URI: f.URI, + } +} + type FlavorData struct { // Model flavor-specific data. Data map[string]*string } -// ForecastHorizonClassification provides polymorphic access to related types. -// Call the interface's GetForecastHorizon() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoForecastHorizon, *CustomForecastHorizon, *ForecastHorizon -type ForecastHorizonClassification interface { - // GetForecastHorizon returns the ForecastHorizon content of the underlying type. - GetForecastHorizon() *ForecastHorizon -} - // ForecastHorizon - The desired maximum forecast horizon in units of time-series frequency. type ForecastHorizon struct { // REQUIRED; [Required] Set forecast horizon value selection mode. @@ -3405,6 +4589,9 @@ type Forecasting struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *TableVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *TableFixedParameters + // Forecasting task specific inputs. ForecastingSettings *ForecastingSettings @@ -3420,6 +4607,12 @@ type Forecasting struct { // Primary metric for forecasting task. PrimaryMetric *ForecastingPrimaryMetrics + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*TableParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *TableSweepSettings + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. TargetColumnName *string @@ -3468,6 +4661,11 @@ type ForecastingSettings struct { // Flag for generating lags for the numeric features with 'auto' or null. FeatureLags *FeatureLags + // The feature columns that are available for training but unknown at the time of forecast/inference. If featuresunknownatforecasttime + // is not set, it is assumed that all the feature columns in the + // dataset are known at inference time. + FeaturesUnknownAtForecastTime []*string + // The desired maximum forecast horizon in units of time-series frequency. ForecastHorizon ForecastHorizonClassification @@ -3511,31 +4709,166 @@ type ForecastingTrainingSettings struct { // Allowed models for forecasting task. AllowedTrainingAlgorithms []*ForecastingModels - // Blocked models for forecasting task. - BlockedTrainingAlgorithms []*ForecastingModels + // Blocked models for forecasting task. + BlockedTrainingAlgorithms []*ForecastingModels + + // Enable recommendation of DNN models. + EnableDnnTraining *bool + + // Flag to turn on explainability on best model. + EnableModelExplainability *bool + + // Flag for enabling onnx compatible models. + EnableOnnxCompatibleModels *bool + + // Enable stack ensemble run. + EnableStackEnsemble *bool + + // Enable voting ensemble run. + EnableVoteEnsemble *bool + + // During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded. + // Configure this parameter with a higher value than 300 secs, if more time + // is needed. + EnsembleModelDownloadTimeout *string + + // Stack ensemble settings for stack ensemble run. + StackEnsembleSettings *StackEnsembleSettings + + // 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. + TrainingMode *TrainingMode +} + +// FqdnOutboundRule - FQDN Outbound Rule for the managed network of a machine learning workspace. +type FqdnOutboundRule struct { + // REQUIRED; Type of a managed network outbound rule of a machine learning workspace. + Type *RuleType + + // Category of a managed network outbound rule of a machine learning workspace. + Category *RuleCategory + Destination *string + + // Type of a managed network outbound rule of a machine learning workspace. + Status *RuleStatus +} + +// GetOutboundRule implements the OutboundRuleClassification interface for type FqdnOutboundRule. +func (f *FqdnOutboundRule) GetOutboundRule() *OutboundRule { + return &OutboundRule{ + Category: f.Category, + Status: f.Status, + Type: f.Type, + } +} + +// GenerationSafetyQualityMetricThreshold - Generation safety quality metric threshold definition. +type GenerationSafetyQualityMetricThreshold struct { + // REQUIRED; [Required] Gets or sets the feature attribution metric to calculate. + Metric *GenerationSafetyQualityMetric + + // Gets or sets the threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GenerationSafetyQualityMonitoringSignal - Generation safety quality monitoring signal definition. +type GenerationSafetyQualityMonitoringSignal struct { + // REQUIRED; [Required] Gets or sets the metrics to calculate and the corresponding thresholds. + MetricThresholds []*GenerationSafetyQualityMetricThreshold + + // REQUIRED; [Required] The sample rate of the production data, should be greater than 0 and at most 1. + SamplingRate *float64 + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Gets or sets the production data for computing metrics. + ProductionData []MonitoringInputDataBaseClassification + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string + + // Gets or sets the workspace connection ID used to connect to the content generation endpoint. + WorkspaceConnectionID *string +} + +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type GenerationSafetyQualityMonitoringSignal. +func (g *GenerationSafetyQualityMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: g.NotificationTypes, + Properties: g.Properties, + SignalType: g.SignalType, + } +} + +// GenerationTokenUsageMetricThreshold - Generation token statistics metric threshold definition. +type GenerationTokenUsageMetricThreshold struct { + // REQUIRED; [Required] Gets or sets the feature attribution metric to calculate. + Metric *GenerationTokenUsageMetric + + // Gets or sets the threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GenerationTokenUsageSignal - Generation token usage signal definition. +type GenerationTokenUsageSignal struct { + // REQUIRED; [Required] Gets or sets the metrics to calculate and the corresponding thresholds. + MetricThresholds []*GenerationTokenUsageMetricThreshold + + // REQUIRED; [Required] The sample rate of the production data, should be greater than 0 and at most 1. + SamplingRate *float64 + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Gets or sets the production data for computing metrics. + ProductionData []MonitoringInputDataBaseClassification - // Enable recommendation of DNN models. - EnableDnnTraining *bool + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string +} - // Flag to turn on explainability on best model. - EnableModelExplainability *bool +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type GenerationTokenUsageSignal. +func (g *GenerationTokenUsageSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: g.NotificationTypes, + Properties: g.Properties, + SignalType: g.SignalType, + } +} - // Flag for enabling onnx compatible models. - EnableOnnxCompatibleModels *bool +type GetBlobReferenceForConsumptionDto struct { + // Blob uri, example: https://blob.windows.core.net/Container/Path + BlobURI *string - // Enable stack ensemble run. - EnableStackEnsemble *bool + // Credential info to access storage account + Credential DataReferenceCredentialClassification - // Enable voting ensemble run. - EnableVoteEnsemble *bool + // The ARM id of the storage account + StorageAccountArmID *string +} - // During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded. - // Configure this parameter with a higher value than 300 secs, if more time - // is needed. - EnsembleModelDownloadTimeout *string +// GetBlobReferenceSASRequestDto - BlobReferenceSASRequest for getBlobReferenceSAS API +type GetBlobReferenceSASRequestDto struct { + // Id of the asset to be accessed + AssetID *string - // Stack ensemble settings for stack ensemble run. - StackEnsembleSettings *StackEnsembleSettings + // Blob uri of the asset to be accessed + BlobURI *string +} + +// GetBlobReferenceSASResponseDto - BlobReferenceSASResponse for getBlobReferenceSAS API +type GetBlobReferenceSASResponseDto struct { + // Blob reference for consumption details + BlobReferenceForConsumption *GetBlobReferenceForConsumptionDto } // GridSamplingAlgorithm - Defines a Sampling Algorithm that exhaustively generates every value combination in the space @@ -3551,6 +4884,20 @@ func (g *GridSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { } } +type GroupStatus struct { + // Gets or sets the actual capacity info for the group. + ActualCapacityInfo *ActualCapacityInfo + + // Gets or sets capacity used from the pool's reserved capacity. + BonusExtraCapacity *int32 + + // Gets or sets the actual number of endpoints in the group. + EndpointCount *int32 + + // Gets or sets the request number of instances for the group. + RequestedCapacity *int32 +} + // HDInsight - A HDInsight compute. type HDInsight struct { // REQUIRED; The type of compute @@ -3591,16 +4938,16 @@ type HDInsight struct { // GetCompute implements the ComputeClassification interface for type HDInsight. func (h *HDInsight) GetCompute() *Compute { return &Compute{ - ComputeType: h.ComputeType, ComputeLocation: h.ComputeLocation, - ProvisioningState: h.ProvisioningState, - Description: h.Description, + ComputeType: h.ComputeType, CreatedOn: h.CreatedOn, + Description: h.Description, + DisableLocalAuth: h.DisableLocalAuth, + IsAttachedCompute: h.IsAttachedCompute, ModifiedOn: h.ModifiedOn, - ResourceID: h.ResourceID, ProvisioningErrors: h.ProvisioningErrors, - IsAttachedCompute: h.IsAttachedCompute, - DisableLocalAuth: h.DisableLocalAuth, + ProvisioningState: h.ProvisioningState, + ResourceID: h.ResourceID, } } @@ -3621,6 +4968,51 @@ type HDInsightSchema struct { Properties *HDInsightProperties } +type HdfsDatastore struct { + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType + + // REQUIRED; [Required] IP Address or DNS HostName. + NameNodeAddress *string + + // The asset description text. + Description *string + + // The TLS cert of the HDFS server. Needs to be a base64 encoded string. Required if "Https" protocol is selected. + HdfsServerCertificate *string + + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + + // The asset property dictionary. + Properties map[string]*string + + // Protocol used to communicate with the storage account (Https/Http). + Protocol *string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type HdfsDatastore. +func (h *HdfsDatastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: h.Credentials, + DatastoreType: h.DatastoreType, + Description: h.Description, + IntellectualProperty: h.IntellectualProperty, + IsDefault: h.IsDefault, + Properties: h.Properties, + Tags: h.Tags, + } +} + // IDAssetReference - Reference to an asset via its ARM resource ID. type IDAssetReference struct { // REQUIRED; [Required] ARM resource ID of the asset. @@ -3637,15 +5029,6 @@ func (i *IDAssetReference) GetAssetReferenceBase() *AssetReferenceBase { } } -// IdentityConfigurationClassification provides polymorphic access to related types. -// Call the interface's GetIdentityConfiguration() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AmlToken, *IdentityConfiguration, *ManagedIdentity, *UserIdentity -type IdentityConfigurationClassification interface { - // GetIdentityConfiguration returns the IdentityConfiguration content of the underlying type. - GetIdentityConfiguration() *IdentityConfiguration -} - // IdentityConfiguration - Base definition for identity configuration. type IdentityConfiguration struct { // REQUIRED; [Required] Specifies the type of identity framework. @@ -3655,12 +5038,33 @@ type IdentityConfiguration struct { // GetIdentityConfiguration implements the IdentityConfigurationClassification interface for type IdentityConfiguration. func (i *IdentityConfiguration) GetIdentityConfiguration() *IdentityConfiguration { return i } -// IdentityForCmk - Identity that will be used to access key vault for encryption at rest +// IdentityForCmk - Identity object used for encryption. type IdentityForCmk struct { - // The ArmId of the user assigned identity that will be used to access the customer managed key vault + // UserAssignedIdentity to be used to fetch the encryption key from keyVault UserAssignedIdentity *string } +// IdleShutdownSetting - Stops compute instance after user defined period of inactivity. +type IdleShutdownSetting struct { + // Time is defined in ISO8601 format. Minimum is 15 min, maximum is 3 days. + IdleTimeBeforeShutdown *string +} + +type Image struct { + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any + + // Image reference URL if type is docker. Environment name if type is azureml + Reference *string + + // Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and + // curated) + Type *ImageType + + // Version of image being used. If latest then skip this field + Version *string +} + // ImageClassification - Image Classification. Multi-class image classification is used when an image is classified with only // a single label from a set of classes - e.g. each image is classified as either an image of a 'cat' // or a 'dog' or a 'duck'. @@ -3839,13 +5243,30 @@ type ImageLimitSettings struct { Timeout *string } -// ImageModelDistributionSettings - Distribution expressions to sweep over values of model settings.Some examples are:ModelName -// = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, -// 2)";All distributions can be specified as distribution_name(min, max) or choice(val1, val2, …, valn) where distribution -// name can be: uniform, quniform, loguniform, etc For more details on how to -// compose distribution expressions please check the documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -// For more information on the available settings -// please visit the official documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +// ImageMetadata - Returns metadata about the operating system image for this compute instance. +type ImageMetadata struct { + // Specifies the current operating system image version this compute instance is running on. + CurrentImageVersion *string + + // Specifies whether this compute instance is running on the latest operating system image. + IsLatestOsImageVersion *bool + + // Specifies the latest available operating system image version. + LatestImageVersion *string + + // READ-ONLY; Metadata about the os patching. + OSPatchingStatus *OsPatchingStatus +} + +// ImageModelDistributionSettings - Distribution expressions to sweep over values of model settings.Some examples are: +// ModelName = "choice('seresnext', 'resnest50')"; +// LearningRate = "uniform(0.001, 0.01)"; +// LayersToFreeze = "choice(0, 2)"; +// All distributions can be specified as distribution_name(min, max) or choice(val1, val2, …, valn) where distribution name +// can be: uniform, quniform, loguniform, etc For more details on how to compose +// distribution expressions please check the documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +// For more information on the available settings please visit +// the official documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. type ImageModelDistributionSettings struct { // Enable AMSGrad when optimizer is 'adam' or 'adamw'. AmsGradient *string @@ -3940,10 +5361,13 @@ type ImageModelDistributionSettings struct { } // ImageModelDistributionSettingsClassification - Distribution expressions to sweep over values of model settings.Some examples -// are:ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, -// 2)";For more details on how to compose distribution expressions please check the documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -// For more information -// on the available settings please visit the official documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +// are: +// ModelName = "choice('seresnext', 'resnest50')"; +// LearningRate = "uniform(0.001, 0.01)"; +// LayersToFreeze = "choice(0, 2)"; +// For more details on how to compose distribution expressions please check the documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +// For more information on +// the available settings please visit the official documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. type ImageModelDistributionSettingsClassification struct { // Enable AMSGrad when optimizer is 'adam' or 'adamw'. AmsGradient *string @@ -4051,10 +5475,13 @@ type ImageModelDistributionSettingsClassification struct { } // ImageModelDistributionSettingsObjectDetection - Distribution expressions to sweep over values of model settings.Some examples -// are:ModelName = "choice('seresnext', 'resnest50')"; LearningRate = "uniform(0.001, 0.01)"; LayersToFreeze = "choice(0, -// 2)";For more details on how to compose distribution expressions please check the documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters -// For more information -// on the available settings please visit the official documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. +// are: +// ModelName = "choice('seresnext', 'resnest50')"; +// LearningRate = "uniform(0.001, 0.01)"; +// LayersToFreeze = "choice(0, 2)"; +// For more details on how to compose distribution expressions please check the documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters +// For more information on +// the available settings please visit the official documentation: https://docs.microsoft.com/en-us/azure/machine-learning/how-to-auto-train-image-models. type ImageModelDistributionSettingsObjectDetection struct { // Enable AMSGrad when optimizer is 'adam' or 'adamw'. AmsGradient *string @@ -4506,6 +5933,12 @@ type ImageModelSettingsObjectDetection struct { // Type of learning rate scheduler. Must be 'warmup_cosine' or 'step'. LearningRateScheduler *LearningRateScheduler + // Enable computing and logging training metrics. + LogTrainingMetrics *LogTrainingMetrics + + // Enable computing and logging validation loss. + LogValidationLoss *LogValidationLoss + // 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. Note: This settings is not // supported for the 'yolov5' algorithm. @@ -4670,34 +6103,258 @@ type ImageSweepSettings struct { EarlyTermination EarlyTerminationPolicyClassification } -// ImageVertical - Abstract class for AutoML tasks that train image (computer vision) models - such as Image Classification -// / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. -type ImageVertical struct { - // REQUIRED; [Required] Limit settings for the AutoML job. - LimitSettings *ImageLimitSettings +// ImageVertical - Abstract class for AutoML tasks that train image (computer vision) models - such as Image Classification +// / Image Classification Multilabel / Image Object Detection / Image Instance Segmentation. +type ImageVertical struct { + // REQUIRED; [Required] Limit settings for the AutoML job. + LimitSettings *ImageLimitSettings + + // Model sweeping and hyperparameter sweeping related settings. + SweepSettings *ImageSweepSettings + + // Validation data inputs. + ValidationData *MLTableJobInput + + // The fraction of training dataset that needs to be set aside for validation purpose. Values between (0.0 , 1.0) Applied + // when validation dataset is not provided. + ValidationDataSize *float64 +} + +type ImportDataAction struct { + // REQUIRED; [Required] Specifies the action type of the schedule + ActionType *ScheduleActionType + + // REQUIRED; [Required] Defines Schedule action definition details. + DataImportDefinition *DataImport +} + +// GetScheduleActionBase implements the ScheduleActionBaseClassification interface for type ImportDataAction. +func (i *ImportDataAction) GetScheduleActionBase() *ScheduleActionBase { + return &ScheduleActionBase{ + ActionType: i.ActionType, + } +} + +// IndexColumn - Dto object representing index column +type IndexColumn struct { + // Specifies the column name + ColumnName *string + + // Specifies the data type + DataType *FeatureDataType +} + +type InferenceContainerProperties struct { + // The route to check the liveness of the inference server container. + LivenessRoute *Route + + // The route to check the readiness of the inference server container. + ReadinessRoute *Route + + // The port to send the scoring requests to, within the inference server container. + ScoringRoute *Route +} + +type InferenceEndpoint struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *InferenceEndpointProperties + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// InferenceEndpointProperties - InferenceEndpoint configuration +type InferenceEndpointProperties struct { + // REQUIRED; [Required] Authentication mode for the endpoint. + AuthMode *AuthMode + + // REQUIRED; [Required] Group within the same pool with which this endpoint needs to be associated with. + GroupID *string + + // Description of the resource. + Description *string + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string + + // READ-ONLY; Endpoint URI for the inference endpoint. + EndpointURI *string + + // READ-ONLY; Provisioning state for the endpoint. + ProvisioningState *PoolProvisioningState +} + +// InferenceEndpointTrackedResourceArmPaginatedResult - A paginated list of InferenceEndpoint entities. +type InferenceEndpointTrackedResourceArmPaginatedResult struct { + // The link to the next page of InferenceEndpoint objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type InferenceEndpoint. + Value []*InferenceEndpoint +} + +type InferenceGroup struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *InferenceGroupProperties + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// InferenceGroupProperties - Inference group configuration +type InferenceGroupProperties struct { + // Capacity to be used from the pool's reserved capacity. optional + BonusExtraCapacity *int32 + + // Description of the resource. + Description *string + + // Metadata for the inference group. + Metadata *string + + // Priority of the group within the N:Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20230801Preview.Pools.InferencePools. + Priority *int32 + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string + + // READ-ONLY; Provisioning state for the inference group. + ProvisioningState *PoolProvisioningState +} + +// InferenceGroupTrackedResourceArmPaginatedResult - A paginated list of InferenceGroup entities. +type InferenceGroupTrackedResourceArmPaginatedResult struct { + // The link to the next page of InferenceGroup objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type InferenceGroup. + Value []*InferenceGroup +} + +type InferencePool struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *InferencePoolProperties + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// InferencePoolProperties - Inference pool configuration +type InferencePoolProperties struct { + // REQUIRED; [Required] Compute instance type. + NodeSKUType *string + + // Code configuration for the inference pool. + CodeConfiguration *CodeConfiguration + + // Description of the resource. + Description *string + + // EnvironmentConfiguration for the inference pool. + EnvironmentConfiguration *PoolEnvironmentConfiguration - // Model sweeping and hyperparameter sweeping related settings. - SweepSettings *ImageSweepSettings + // ModelConfiguration for the inference pool. + ModelConfiguration *PoolModelConfiguration - // Validation data inputs. - ValidationData *MLTableJobInput + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string - // The fraction of training dataset that needs to be set aside for validation purpose. Values between (0.0 , 1.0) Applied - // when validation dataset is not provided. - ValidationDataSize *float64 + // Request configuration for the inference pool. + RequestConfiguration *RequestConfiguration + + // READ-ONLY; Provisioning state for the pool. + ProvisioningState *PoolProvisioningState } -type InferenceContainerProperties struct { - // The route to check the liveness of the inference server container. - LivenessRoute *Route +// InferencePoolTrackedResourceArmPaginatedResult - A paginated list of InferencePool entities. +type InferencePoolTrackedResourceArmPaginatedResult struct { + // The link to the next page of InferencePool objects. If null, there are no additional pages. + NextLink *string - // The route to check the readiness of the inference server container. - ReadinessRoute *Route + // An array of objects of type InferencePool. + Value []*InferencePool +} - // The port to send the scoring requests to, within the inference server container. - ScoringRoute *Route +type InferencingServer struct { + // REQUIRED; [Required] Inferencing server type for various targets. + ServerType *InferencingServerType } +// GetInferencingServer implements the InferencingServerClassification interface for type InferencingServer. +func (i *InferencingServer) GetInferencingServer() *InferencingServer { return i } + // InstanceTypeSchema - Instance type schema. type InstanceTypeSchema struct { // Node Selector @@ -4716,6 +6373,15 @@ type InstanceTypeSchemaResources struct { Requests map[string]*string } +// IntellectualProperty - Intellectual Property details for a resource. +type IntellectualProperty struct { + // REQUIRED; [Required] Publisher of the Intellectual Property. Must be the same as Registry publisher name. + Publisher *string + + // Protection level of the Intellectual Property. + ProtectionLevel *ProtectionLevel +} + // JobBase - Azure Resource Manager resource envelope. type JobBase struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -4734,15 +6400,6 @@ type JobBase struct { Type *string } -// JobBasePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetJobBaseProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoMLJob, *CommandJob, *JobBaseProperties, *PipelineJob, *SweepJob -type JobBasePropertiesClassification interface { - // GetJobBaseProperties returns the JobBaseProperties content of the underlying type. - GetJobBaseProperties() *JobBaseProperties -} - // JobBaseProperties - Base definition for a job. type JobBaseProperties struct { // REQUIRED; [Required] Specifies the type of job. @@ -4770,9 +6427,15 @@ type JobBaseProperties struct { // Is the asset archived? IsArchived *bool + // Notification setting for the job + NotificationSetting *NotificationSetting + // The asset property dictionary. Properties map[string]*string + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. Services map[string]*JobService @@ -4795,16 +6458,6 @@ type JobBaseResourceArmPaginatedResult struct { Value []*JobBase } -// JobInputClassification provides polymorphic access to related types. -// Call the interface's GetJobInput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CustomModelJobInput, *JobInput, *LiteralJobInput, *MLFlowModelJobInput, *MLTableJobInput, *TritonModelJobInput, *URIFileJobInput, -// - *URIFolderJobInput -type JobInputClassification interface { - // GetJobInput returns the JobInput content of the underlying type. - GetJobInput() *JobInput -} - // JobInput - Command job definition. type JobInput struct { // REQUIRED; [Required] Specifies the type of job. @@ -4817,15 +6470,6 @@ type JobInput struct { // GetJobInput implements the JobInputClassification interface for type JobInput. func (j *JobInput) GetJobInput() *JobInput { return j } -// JobLimitsClassification provides polymorphic access to related types. -// Call the interface's GetJobLimits() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CommandJobLimits, *JobLimits, *SweepJobLimits -type JobLimitsClassification interface { - // GetJobLimits returns the JobLimits content of the underlying type. - GetJobLimits() *JobLimits -} - type JobLimits struct { // REQUIRED; [Required] JobLimit type. JobLimitsType *JobLimitsType @@ -4838,16 +6482,6 @@ type JobLimits struct { // GetJobLimits implements the JobLimitsClassification interface for type JobLimits. func (j *JobLimits) GetJobLimits() *JobLimits { return j } -// JobOutputClassification provides polymorphic access to related types. -// Call the interface's GetJobOutput() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CustomModelJobOutput, *JobOutput, *MLFlowModelJobOutput, *MLTableJobOutput, *TritonModelJobOutput, *URIFileJobOutput, -// - *URIFolderJobOutput -type JobOutputClassification interface { - // GetJobOutput returns the JobOutput content of the underlying type. - GetJobOutput() *JobOutput -} - // JobOutput - Job output definition container information on where to find job output/logs. type JobOutput struct { // REQUIRED; [Required] Specifies the type of job. @@ -4872,6 +6506,13 @@ type JobResourceConfiguration struct { // Optional type of VM used as supported by the compute target. InstanceType *string + // Locations where the job can run. + Locations []*string + + // 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. + MaxInstanceCount *int32 + // Additional properties bag. Properties map[string]any @@ -4904,7 +6545,11 @@ type JobService struct { // Endpoint type. JobServiceType *string - // Port for endpoint. + // Nodes that user would like to start the service on. If Nodes is not set or set to null, the service will only be started + // on leader node. + Nodes NodesClassification + + // Port for endpoint set by user. Port *int32 // Additional properties to set on the endpoint. @@ -4917,38 +6562,120 @@ type JobService struct { Status *string } -// JobsClientBeginCancelOptions contains the optional parameters for the JobsClient.BeginCancel method. -type JobsClientBeginCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// JupyterKernelConfig - Jupyter kernel configuration. +type JupyterKernelConfig struct { + // Argument to the the runtime + Argv []*string + + // Display name of the kernel + DisplayName *string + + // Language of the kernel [Example value: python] + Language *string +} + +type KerberosCredentials struct { + // REQUIRED; [Required] IP Address or DNS HostName. + KerberosKdcAddress *string + + // REQUIRED; [Required] Kerberos Username + KerberosPrincipal *string + + // REQUIRED; [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host + // or service. + KerberosRealm *string +} + +type KerberosKeytabCredentials struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType + + // REQUIRED; [Required] IP Address or DNS HostName. + KerberosKdcAddress *string + + // REQUIRED; [Required] Kerberos Username + KerberosPrincipal *string + + // REQUIRED; [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host + // or service. + KerberosRealm *string + + // REQUIRED; [Required] Keytab secrets. + Secrets *KerberosKeytabSecrets +} + +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type KerberosKeytabCredentials. +func (k *KerberosKeytabCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: k.CredentialsType, + } +} + +type KerberosKeytabSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType + + // Kerberos keytab secret. + KerberosKeytab *string +} + +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type KerberosKeytabSecrets. +func (k *KerberosKeytabSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: k.SecretsType, + } +} + +type KerberosPasswordCredentials struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialsType *CredentialsType + + // REQUIRED; [Required] IP Address or DNS HostName. + KerberosKdcAddress *string + + // REQUIRED; [Required] Kerberos Username + KerberosPrincipal *string + + // REQUIRED; [Required] Domain over which a Kerberos authentication server has the authority to authenticate a user, host + // or service. + KerberosRealm *string + + // REQUIRED; [Required] Kerberos password secrets. + Secrets *KerberosPasswordSecrets } -// JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. -type JobsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// GetDatastoreCredentials implements the DatastoreCredentialsClassification interface for type KerberosPasswordCredentials. +func (k *KerberosPasswordCredentials) GetDatastoreCredentials() *DatastoreCredentials { + return &DatastoreCredentials{ + CredentialsType: k.CredentialsType, + } } -// JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. -type JobsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +type KerberosPasswordSecrets struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + SecretsType *SecretsType + + // Kerberos password secret. + KerberosPassword *string } -// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. -type JobsClientGetOptions struct { - // placeholder for future optional parameters +// GetDatastoreSecrets implements the DatastoreSecretsClassification interface for type KerberosPasswordSecrets. +func (k *KerberosPasswordSecrets) GetDatastoreSecrets() *DatastoreSecrets { + return &DatastoreSecrets{ + SecretsType: k.SecretsType, + } } -// JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. -type JobsClientListOptions struct { - // Type of job to be returned. - JobType *string - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Continuation token for pagination. - Skip *string - // Jobs returned will have this tag key. - Tag *string +// KeyVaultProperties - Customer Key vault properties. +type KeyVaultProperties struct { + // REQUIRED; KeyVault key identifier to encrypt the data + KeyIdentifier *string + + // REQUIRED; KeyVault Arm Id that contains the data encryption key + KeyVaultArmID *string + + // Currently, we support only SystemAssigned MSI. We need this when we support UserAssignedIdentities + IdentityClientID *string } // Kubernetes - A Machine Learning compute based on Kubernetes Compute. @@ -4991,16 +6718,16 @@ type Kubernetes struct { // GetCompute implements the ComputeClassification interface for type Kubernetes. func (k *Kubernetes) GetCompute() *Compute { return &Compute{ - ComputeType: k.ComputeType, ComputeLocation: k.ComputeLocation, - ProvisioningState: k.ProvisioningState, - Description: k.Description, + ComputeType: k.ComputeType, CreatedOn: k.CreatedOn, + Description: k.Description, + DisableLocalAuth: k.DisableLocalAuth, + IsAttachedCompute: k.IsAttachedCompute, ModifiedOn: k.ModifiedOn, - ResourceID: k.ResourceID, ProvisioningErrors: k.ProvisioningErrors, - IsAttachedCompute: k.IsAttachedCompute, - DisableLocalAuth: k.DisableLocalAuth, + ProvisioningState: k.ProvisioningState, + ResourceID: k.ResourceID, } } @@ -5018,13 +6745,16 @@ type KubernetesOnlineDeployment struct { // The resource requirements for the container (cpu and memory). ContainerResourceRequirements *ContainerResourceRequirements + // The mdc configuration, we disable mdc when it's null. + DataCollector *DataCollector + // Description of the endpoint deployment. Description *string // If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. EgressPublicNetworkAccess *EgressPublicNetworkAccessType - // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + // ARM resource ID of the environment specification for the endpoint deployment. EnvironmentID *string // Environment variables configuration for the deployment. @@ -5064,21 +6794,22 @@ type KubernetesOnlineDeployment struct { func (k *KubernetesOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDeploymentProperties { return &OnlineDeploymentProperties{ AppInsightsEnabled: k.AppInsightsEnabled, + CodeConfiguration: k.CodeConfiguration, + DataCollector: k.DataCollector, + Description: k.Description, EgressPublicNetworkAccess: k.EgressPublicNetworkAccess, EndpointComputeType: k.EndpointComputeType, + EnvironmentID: k.EnvironmentID, + EnvironmentVariables: k.EnvironmentVariables, InstanceType: k.InstanceType, LivenessProbe: k.LivenessProbe, Model: k.Model, ModelMountPath: k.ModelMountPath, + Properties: k.Properties, ProvisioningState: k.ProvisioningState, ReadinessProbe: k.ReadinessProbe, RequestSettings: k.RequestSettings, ScaleSettings: k.ScaleSettings, - CodeConfiguration: k.CodeConfiguration, - Description: k.Description, - EnvironmentID: k.EnvironmentID, - EnvironmentVariables: k.EnvironmentVariables, - Properties: k.Properties, } } @@ -5115,6 +6846,224 @@ type KubernetesSchema struct { Properties *KubernetesProperties } +// LabelCategory - Label category definition +type LabelCategory struct { + // Dictionary of label classes in this category. + Classes map[string]*LabelClass + + // Display name of the label category. + DisplayName *string + + // Indicates whether it is allowed to select multiple classes in this category. + MultiSelect *MultiSelect +} + +// LabelClass - Label class definition +type LabelClass struct { + // Display name of the label class. + DisplayName *string + + // Dictionary of subclasses of the label class. + Subclasses map[string]*LabelClass +} + +// LabelingDataConfiguration - Labeling data configuration definition +type LabelingDataConfiguration struct { + // Resource Id of the data asset to perform labeling. + DataID *string + + // Indicates whether to enable incremental data refresh. + IncrementalDataRefresh *IncrementalDataRefresh +} + +// LabelingJob - Azure Resource Manager resource envelope. +type LabelingJob struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *LabelingJobProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// LabelingJobImageProperties - Properties of a labeling job for image data +type LabelingJobImageProperties struct { + // REQUIRED; [Required] Media type of the job. + MediaType *MediaType + + // Annotation type of image labeling job. + AnnotationType *ImageAnnotationType +} + +// GetLabelingJobMediaProperties implements the LabelingJobMediaPropertiesClassification interface for type LabelingJobImageProperties. +func (l *LabelingJobImageProperties) GetLabelingJobMediaProperties() *LabelingJobMediaProperties { + return &LabelingJobMediaProperties{ + MediaType: l.MediaType, + } +} + +// LabelingJobInstructions - Instructions for labeling job +type LabelingJobInstructions struct { + // The link to a page with detailed labeling instructions for labelers. + URI *string +} + +// LabelingJobMediaProperties - Properties of a labeling job +type LabelingJobMediaProperties struct { + // REQUIRED; [Required] Media type of the job. + MediaType *MediaType +} + +// GetLabelingJobMediaProperties implements the LabelingJobMediaPropertiesClassification interface for type LabelingJobMediaProperties. +func (l *LabelingJobMediaProperties) GetLabelingJobMediaProperties() *LabelingJobMediaProperties { + return l +} + +// LabelingJobProperties - Labeling job definition +type LabelingJobProperties struct { + // REQUIRED; [Required] Specifies the type of job. + JobType *JobType + + // ARM resource ID of the component resource. + ComponentID *string + + // ARM resource ID of the compute resource. + ComputeID *string + + // Configuration of data used in the job. + DataConfiguration *LabelingDataConfiguration + + // The asset description text. + Description *string + + // Display name of job. + DisplayName *string + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification + + // Is the asset archived? + IsArchived *bool + + // Labeling instructions of the job. + JobInstructions *LabelingJobInstructions + + // Label categories of the job. + LabelCategories map[string]*LabelCategory + + // Media type specific properties in the job. + LabelingJobMediaProperties LabelingJobMediaPropertiesClassification + + // Configuration of MLAssist feature in the job. + MlAssistConfiguration MLAssistConfigurationClassification + + // Notification setting for the job + NotificationSetting *NotificationSetting + + // The asset property dictionary. + Properties map[string]*string + + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Created time of the job in UTC timezone. + CreatedDateTime *time.Time + + // READ-ONLY; Progress metrics of the job. + ProgressMetrics *ProgressMetrics + + // READ-ONLY; Internal id of the job(Previously called project). + ProjectID *string + + // READ-ONLY; Specifies the labeling job provisioning state. + ProvisioningState *JobProvisioningState + + // READ-ONLY; Status of the job. + Status *JobStatus + + // READ-ONLY; Status messages of the job. + StatusMessages []*StatusMessage +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type LabelingJobProperties. +func (l *LabelingJobProperties) GetJobBaseProperties() *JobBaseProperties { + return &JobBaseProperties{ + ComponentID: l.ComponentID, + ComputeID: l.ComputeID, + Description: l.Description, + DisplayName: l.DisplayName, + ExperimentName: l.ExperimentName, + Identity: l.Identity, + IsArchived: l.IsArchived, + JobType: l.JobType, + NotificationSetting: l.NotificationSetting, + Properties: l.Properties, + SecretsConfiguration: l.SecretsConfiguration, + Services: l.Services, + Status: l.Status, + Tags: l.Tags, + } +} + +// LabelingJobResourceArmPaginatedResult - A paginated list of LabelingJob entities. +type LabelingJobResourceArmPaginatedResult struct { + // The link to the next page of LabelingJob objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type LabelingJob. + Value []*LabelingJob +} + +// LabelingJobTextProperties - Properties of a labeling job for text data +type LabelingJobTextProperties struct { + // REQUIRED; [Required] Media type of the job. + MediaType *MediaType + + // Annotation type of text labeling job. + AnnotationType *TextAnnotationType +} + +// GetLabelingJobMediaProperties implements the LabelingJobMediaPropertiesClassification interface for type LabelingJobTextProperties. +func (l *LabelingJobTextProperties) GetLabelingJobMediaProperties() *LabelingJobMediaProperties { + return &LabelingJobMediaProperties{ + MediaType: l.MediaType, + } +} + +type LakeHouseArtifact struct { + // REQUIRED; [Required] OneLake artifact name + ArtifactName *string + + // REQUIRED; [Required] OneLake artifact type + ArtifactType *OneLakeArtifactType +} + +// GetOneLakeArtifact implements the OneLakeArtifactClassification interface for type LakeHouseArtifact. +func (l *LakeHouseArtifact) GetOneLakeArtifact() *OneLakeArtifact { + return &OneLakeArtifact{ + ArtifactName: l.ArtifactName, + ArtifactType: l.ArtifactType, + } +} + // ListAmlUserFeatureResult - The List Aml user feature operation response. type ListAmlUserFeatureResult struct { // READ-ONLY; The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next @@ -5126,15 +7075,15 @@ type ListAmlUserFeatureResult struct { } type ListNotebookKeysResult struct { - // READ-ONLY + // READ-ONLY; The primary access key of the Notebook PrimaryAccessKey *string - // READ-ONLY + // READ-ONLY; The secondary access key of the Notebook SecondaryAccessKey *string } type ListStorageAccountKeysResult struct { - // READ-ONLY + // READ-ONLY; The access key of the storage UserStorageKey *string } @@ -5149,20 +7098,17 @@ type ListUsagesResult struct { } type ListWorkspaceKeysResult struct { - // READ-ONLY - AppInsightsInstrumentationKey *string - - // READ-ONLY ContainerRegistryCredentials *RegistryListCredentialsResult + NotebookAccessKeys *ListNotebookKeysResult - // READ-ONLY - NotebookAccessKeys *ListNotebookKeysResult + // READ-ONLY; The access key of the workspace app insights + AppInsightsInstrumentationKey *string - // READ-ONLY - UserStorageKey *string + // READ-ONLY; The arm Id key of the workspace storage + UserStorageArmID *string - // READ-ONLY - UserStorageResourceID *string + // READ-ONLY; The access key of the workspace storage + UserStorageKey *string } // ListWorkspaceQuotas - The List WorkspaceQuotasByVMFamily operation response. @@ -5195,6 +7141,47 @@ func (l *LiteralJobInput) GetJobInput() *JobInput { } } +// MLAssistConfiguration - Labeling MLAssist configuration definition +type MLAssistConfiguration struct { + // REQUIRED; [Required] Indicates whether MLAssist feature is enabled. + MlAssist *MLAssistConfigurationType +} + +// GetMLAssistConfiguration implements the MLAssistConfigurationClassification interface for type MLAssistConfiguration. +func (m *MLAssistConfiguration) GetMLAssistConfiguration() *MLAssistConfiguration { return m } + +// MLAssistConfigurationDisabled - Labeling MLAssist configuration definition when MLAssist is disabled +type MLAssistConfigurationDisabled struct { + // REQUIRED; [Required] Indicates whether MLAssist feature is enabled. + MlAssist *MLAssistConfigurationType +} + +// GetMLAssistConfiguration implements the MLAssistConfigurationClassification interface for type MLAssistConfigurationDisabled. +func (m *MLAssistConfigurationDisabled) GetMLAssistConfiguration() *MLAssistConfiguration { + return &MLAssistConfiguration{ + MlAssist: m.MlAssist, + } +} + +// MLAssistConfigurationEnabled - Labeling MLAssist configuration definition when MLAssist is enabled +type MLAssistConfigurationEnabled struct { + // REQUIRED; [Required] AML compute binding used in inferencing. + InferencingComputeBinding *string + + // REQUIRED; [Required] Indicates whether MLAssist feature is enabled. + MlAssist *MLAssistConfigurationType + + // REQUIRED; [Required] AML compute binding used in training. + TrainingComputeBinding *string +} + +// GetMLAssistConfiguration implements the MLAssistConfigurationClassification interface for type MLAssistConfigurationEnabled. +func (m *MLAssistConfigurationEnabled) GetMLAssistConfiguration() *MLAssistConfiguration { + return &MLAssistConfiguration{ + MlAssist: m.MlAssist, + } +} + type MLFlowModelJobInput struct { // REQUIRED; [Required] Specifies the type of job. JobInputType *JobInputType @@ -5221,6 +7208,15 @@ type MLFlowModelJobOutput struct { // REQUIRED; [Required] Specifies the type of job. JobOutputType *JobOutputType + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Description for the output. Description *string @@ -5244,16 +7240,23 @@ type MLTableData struct { // REQUIRED; [Required] Specifies the type of data. DataType *DataType - // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType + // REQUIRED; [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 DataURI *string + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // Intellectual Property details. Used if data is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. @@ -5262,6 +7265,9 @@ type MLTableData struct { // Uris referenced in the MLTable definition (required for lineage) ReferencedUris []*string + // Stage in the data lifecycle assigned to this data asset + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string } @@ -5269,13 +7275,16 @@ type MLTableData struct { // GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type MLTableData. func (m *MLTableData) GetDataVersionBaseProperties() *DataVersionBaseProperties { return &DataVersionBaseProperties{ - DataType: m.DataType, - DataURI: m.DataURI, - IsAnonymous: m.IsAnonymous, - IsArchived: m.IsArchived, - Description: m.Description, - Properties: m.Properties, - Tags: m.Tags, + AutoDeleteSetting: m.AutoDeleteSetting, + DataType: m.DataType, + DataURI: m.DataURI, + Description: m.Description, + IntellectualProperty: m.IntellectualProperty, + IsAnonymous: m.IsAnonymous, + IsArchived: m.IsArchived, + Properties: m.Properties, + Stage: m.Stage, + Tags: m.Tags, } } @@ -5305,6 +7314,15 @@ type MLTableJobOutput struct { // REQUIRED; [Required] Specifies the type of job. JobOutputType *JobOutputType + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Description for the output. Description *string @@ -5323,6 +7341,22 @@ func (m *MLTableJobOutput) GetJobOutput() *JobOutput { } } +// ManagedComputeIdentity - Managed compute identity definition. +type ManagedComputeIdentity struct { + // REQUIRED; [Required] Monitor compute identity type enum. + ComputeIdentityType *MonitorComputeIdentityType + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity +} + +// GetMonitorComputeIdentityBase implements the MonitorComputeIdentityBaseClassification interface for type ManagedComputeIdentity. +func (m *ManagedComputeIdentity) GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase { + return &MonitorComputeIdentityBase{ + ComputeIdentityType: m.ComputeIdentityType, + } +} + // ManagedIdentity - Managed identity configuration. type ManagedIdentity struct { // REQUIRED; [Required] Specifies the type of identity framework. @@ -5352,26 +7386,91 @@ type ManagedIdentityAuthTypeWorkspaceConnectionProperties struct { // Category of the connection Category *ConnectionCategory Credentials *WorkspaceConnectionManagedIdentity - Target *string + ExpiryTime *time.Time - // Value details of the workspace connection. - Value *string + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string - // format for the workspace connection value - ValueFormat *ValueFormat + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. func (m *ManagedIdentityAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { return &WorkspaceConnectionPropertiesV2{ - AuthType: m.AuthType, - Category: m.Category, - Target: m.Target, - Value: m.Value, - ValueFormat: m.ValueFormat, + AuthType: m.AuthType, + Category: m.Category, + CreatedByWorkspaceArmID: m.CreatedByWorkspaceArmID, + ExpiryTime: m.ExpiryTime, + IsSharedToAll: m.IsSharedToAll, + Metadata: m.Metadata, + Target: m.Target, + } +} + +// ManagedIdentityCredential - Credential for user managed identity +type ManagedIdentityCredential struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *DataReferenceCredentialType + + // ManagedIdentityCredential identity type + ManagedIdentityType *string + + // ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + UserManagedIdentityClientID *string + + // PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + UserManagedIdentityPrincipalID *string + + // Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + UserManagedIdentityResourceID *string + + // TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + UserManagedIdentityTenantID *string +} + +// GetDataReferenceCredential implements the DataReferenceCredentialClassification interface for type ManagedIdentityCredential. +func (m *ManagedIdentityCredential) GetDataReferenceCredential() *DataReferenceCredential { + return &DataReferenceCredential{ + CredentialType: m.CredentialType, } } +// ManagedNetworkProvisionOptions - Managed Network Provisioning options for managed network of a machine learning workspace. +type ManagedNetworkProvisionOptions struct { + IncludeSpark *bool +} + +// ManagedNetworkProvisionStatus - Status of the Provisioning for the managed network of a machine learning workspace. +type ManagedNetworkProvisionStatus struct { + SparkReady *bool + + // Status for the managed network of a machine learning workspace. + Status *ManagedNetworkStatus +} + +// ManagedNetworkSettings - Managed Network settings for a machine learning workspace. +type ManagedNetworkSettings struct { + // Isolation mode for the managed network of a machine learning workspace. + IsolationMode *IsolationMode + + // Dictionary of + OutboundRules map[string]OutboundRuleClassification + + // Status of the Provisioning for the managed network of a machine learning workspace. + Status *ManagedNetworkProvisionStatus + + // READ-ONLY; Detail isolation modes for the managed network of a machine learning workspace. + ChangeableIsolationModes []*IsolationMode + + // READ-ONLY + NetworkID *string +} + // ManagedOnlineDeployment - Properties specific to a ManagedOnlineDeployment. type ManagedOnlineDeployment struct { // REQUIRED; [Required] The compute type of the endpoint. @@ -5383,13 +7482,16 @@ type ManagedOnlineDeployment struct { // Code configuration for the endpoint deployment. CodeConfiguration *CodeConfiguration + // The mdc configuration, we disable mdc when it's null. + DataCollector *DataCollector + // Description of the endpoint deployment. Description *string // If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. EgressPublicNetworkAccess *EgressPublicNetworkAccessType - // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + // ARM resource ID of the environment specification for the endpoint deployment. EnvironmentID *string // Environment variables configuration for the deployment. @@ -5429,21 +7531,22 @@ type ManagedOnlineDeployment struct { func (m *ManagedOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDeploymentProperties { return &OnlineDeploymentProperties{ AppInsightsEnabled: m.AppInsightsEnabled, + CodeConfiguration: m.CodeConfiguration, + DataCollector: m.DataCollector, + Description: m.Description, EgressPublicNetworkAccess: m.EgressPublicNetworkAccess, EndpointComputeType: m.EndpointComputeType, + EnvironmentID: m.EnvironmentID, + EnvironmentVariables: m.EnvironmentVariables, InstanceType: m.InstanceType, LivenessProbe: m.LivenessProbe, Model: m.Model, ModelMountPath: m.ModelMountPath, + Properties: m.Properties, ProvisioningState: m.ProvisioningState, ReadinessProbe: m.ReadinessProbe, RequestSettings: m.RequestSettings, ScaleSettings: m.ScaleSettings, - CodeConfiguration: m.CodeConfiguration, - Description: m.Description, - EnvironmentID: m.EnvironmentID, - EnvironmentVariables: m.EnvironmentVariables, - Properties: m.Properties, } } @@ -5467,6 +7570,29 @@ type ManagedServiceIdentity struct { TenantID *string } +// MaterializationComputeResource - Dto object representing compute resource +type MaterializationComputeResource struct { + // Specifies the instance type + InstanceType *string +} + +type MaterializationSettings struct { + // Specifies the notification details + Notification *NotificationSetting + + // Specifies the compute resource settings + Resource *MaterializationComputeResource + + // Specifies the schedule details + Schedule *RecurrenceTrigger + + // Specifies the spark compute settings + SparkConfiguration map[string]*string + + // Specifies the stores to which materialization should happen + StoreType *MaterializationStoreType +} + // MedianStoppingPolicy - Defines an early termination policy based on running averages of the primary metric of all runs type MedianStoppingPolicy struct { // REQUIRED; [Required] Name of policy configuration @@ -5488,6 +7614,15 @@ func (m *MedianStoppingPolicy) GetEarlyTerminationPolicy() *EarlyTerminationPoli } } +// ModelConfiguration - Model configuration options. +type ModelConfiguration struct { + // Input delivery mode for the model. + Mode *PackageInputDeliveryMode + + // Relative mounting path of the model in the target image. + MountPath *string +} + // ModelContainer - Azure Resource Manager resource envelope. type ModelContainer struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -5524,6 +7659,9 @@ type ModelContainerProperties struct { // READ-ONLY; The next auto incremental version NextVersion *string + + // READ-ONLY; Provisioning state for the model container. + ProvisioningState *AssetProvisioningState } // ModelContainerResourceArmPaginatedResult - A paginated list of ModelContainer entities. @@ -5535,30 +7673,66 @@ type ModelContainerResourceArmPaginatedResult struct { Value []*ModelContainer } -// ModelContainersClientCreateOrUpdateOptions contains the optional parameters for the ModelContainersClient.CreateOrUpdate -// method. -type ModelContainersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// ModelPackageInput - Model package input options. +type ModelPackageInput struct { + // REQUIRED; [Required] Type of the input included in the target image. + InputType *PackageInputType + + // REQUIRED; [Required] Location of the input. + Path PackageInputPathBaseClassification + + // Input delivery mode of the input. + Mode *PackageInputDeliveryMode + + // Relative mount path of the input in the target image. + MountPath *string +} + +type ModelPerformanceMetricThresholdBase struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + ModelType *MonitoringModelType + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold } -// ModelContainersClientDeleteOptions contains the optional parameters for the ModelContainersClient.Delete method. -type ModelContainersClientDeleteOptions struct { - // placeholder for future optional parameters +// GetModelPerformanceMetricThresholdBase implements the ModelPerformanceMetricThresholdBaseClassification interface for type +// ModelPerformanceMetricThresholdBase. +func (m *ModelPerformanceMetricThresholdBase) GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase { + return m } -// ModelContainersClientGetOptions contains the optional parameters for the ModelContainersClient.Get method. -type ModelContainersClientGetOptions struct { - // placeholder for future optional parameters +// ModelPerformanceSignal - Model performance signal definition. +type ModelPerformanceSignal struct { + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThreshold ModelPerformanceMetricThresholdBaseClassification + + // REQUIRED; [Required] The data produced by the production service which performance will be calculated for. + ProductionData []MonitoringInputDataBaseClassification + + // REQUIRED; [Required] The reference data used as the basis to calculate model performance. + ReferenceData MonitoringInputDataBaseClassification + + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // The data segment. + DataSegment *MonitoringDataSegment + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string } -// ModelContainersClientListOptions contains the optional parameters for the ModelContainersClient.NewListPager method. -type ModelContainersClientListOptions struct { - // Maximum number of results to return. - Count *int32 - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Continuation token for pagination. - Skip *string +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type ModelPerformanceSignal. +func (m *ModelPerformanceSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: m.NotificationTypes, + Properties: m.Properties, + SignalType: m.SignalType, + } } // ModelVersion - Azure Resource Manager resource envelope. @@ -5581,16 +7755,23 @@ type ModelVersion struct { // ModelVersionProperties - Model asset version details. type ModelVersionProperties struct { + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // The asset description text. Description *string // Mapping of model flavors to their properties. Flavors map[string]*FlavorData - // If the name version are system generated (anonymous registration). + // Intellectual Property details. Used if model is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // Name of the training job which produced this model @@ -5605,8 +7786,14 @@ type ModelVersionProperties struct { // The asset property dictionary. Properties map[string]*string + // Stage in the model lifecycle assigned to this model + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string + + // READ-ONLY; Provisioning state for the model version. + ProvisioningState *AssetProvisioningState } // ModelVersionResourceArmPaginatedResult - A paginated list of ModelVersion entities. @@ -5618,43 +7805,153 @@ type ModelVersionResourceArmPaginatedResult struct { Value []*ModelVersion } -// ModelVersionsClientCreateOrUpdateOptions contains the optional parameters for the ModelVersionsClient.CreateOrUpdate method. -type ModelVersionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// MonitorComputeConfigurationBase - Monitor compute configuration base definition. +type MonitorComputeConfigurationBase struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + ComputeType *MonitorComputeType } -// ModelVersionsClientDeleteOptions contains the optional parameters for the ModelVersionsClient.Delete method. -type ModelVersionsClientDeleteOptions struct { - // placeholder for future optional parameters +// GetMonitorComputeConfigurationBase implements the MonitorComputeConfigurationBaseClassification interface for type MonitorComputeConfigurationBase. +func (m *MonitorComputeConfigurationBase) GetMonitorComputeConfigurationBase() *MonitorComputeConfigurationBase { + return m } -// ModelVersionsClientGetOptions contains the optional parameters for the ModelVersionsClient.Get method. -type ModelVersionsClientGetOptions struct { - // placeholder for future optional parameters +// MonitorComputeIdentityBase - Monitor compute identity base definition. +type MonitorComputeIdentityBase struct { + // REQUIRED; [Required] Monitor compute identity type enum. + ComputeIdentityType *MonitorComputeIdentityType } -// ModelVersionsClientListOptions contains the optional parameters for the ModelVersionsClient.NewListPager method. -type ModelVersionsClientListOptions struct { - // Model description. - Description *string - // Name of the feed. - Feed *string - // View type for including/excluding (for example) archived entities. - ListViewType *ListViewType - // Number of initial results to skip. - Offset *int32 - // Ordering of list. - OrderBy *string - // Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2 - Properties *string - // Continuation token for pagination. - Skip *string - // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 - Tags *string - // Maximum number of records to return. - Top *int32 - // Model version. - Version *string +// GetMonitorComputeIdentityBase implements the MonitorComputeIdentityBaseClassification interface for type MonitorComputeIdentityBase. +func (m *MonitorComputeIdentityBase) GetMonitorComputeIdentityBase() *MonitorComputeIdentityBase { + return m +} + +type MonitorDefinition struct { + // REQUIRED; [Required] The ARM resource ID of the compute resource to run the monitoring job on. + ComputeConfiguration MonitorComputeConfigurationBaseClassification + + // REQUIRED; [Required] The signals to monitor. + Signals map[string]MonitoringSignalBaseClassification + + // The monitor's notification settings. + AlertNotificationSettings *MonitorNotificationSettings + + // The ARM resource ID of either the model or deployment targeted by this monitor. + MonitoringTarget *MonitoringTarget +} + +type MonitorEmailNotificationSettings struct { + // This is the email recipient list which has a limitation of 499 characters in total. + Emails []*string +} + +type MonitorNotificationSettings struct { + // The AML notification email settings. + EmailNotificationSettings *MonitorEmailNotificationSettings +} + +// MonitorServerlessSparkCompute - Monitor serverless spark compute definition. +type MonitorServerlessSparkCompute struct { + // REQUIRED; [Required] The identity scheme leveraged to by the spark jobs running on serverless Spark. + ComputeIdentity MonitorComputeIdentityBaseClassification + + // REQUIRED; [Required] Specifies the type of signal to monitor. + ComputeType *MonitorComputeType + + // REQUIRED; [Required] The instance type running the Spark job. + InstanceType *string + + // REQUIRED; [Required] The Spark runtime version. + RuntimeVersion *string +} + +// GetMonitorComputeConfigurationBase implements the MonitorComputeConfigurationBaseClassification interface for type MonitorServerlessSparkCompute. +func (m *MonitorServerlessSparkCompute) GetMonitorComputeConfigurationBase() *MonitorComputeConfigurationBase { + return &MonitorComputeConfigurationBase{ + ComputeType: m.ComputeType, + } +} + +type MonitoringDataSegment struct { + // The feature to segment the data on. + Feature *string + + // Filters for only the specified values of the given segmented feature. + Values []*string +} + +type MonitoringFeatureFilterBase struct { + // REQUIRED; [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + FilterType *MonitoringFeatureFilterType +} + +// GetMonitoringFeatureFilterBase implements the MonitoringFeatureFilterBaseClassification interface for type MonitoringFeatureFilterBase. +func (m *MonitoringFeatureFilterBase) GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase { + return m +} + +// MonitoringInputDataBase - Monitoring input data base definition. +type MonitoringInputDataBase struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + InputDataType *MonitoringInputDataType + + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType + + // REQUIRED; [Required] Input Asset URI. + URI *string + + // Mapping of column names to special uses. + Columns map[string]*string + + // The context metadata of the data source. + DataContext *string +} + +// GetMonitoringInputDataBase implements the MonitoringInputDataBaseClassification interface for type MonitoringInputDataBase. +func (m *MonitoringInputDataBase) GetMonitoringInputDataBase() *MonitoringInputDataBase { return m } + +type MonitoringSignalBase struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType + + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string +} + +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type MonitoringSignalBase. +func (m *MonitoringSignalBase) GetMonitoringSignalBase() *MonitoringSignalBase { return m } + +// MonitoringTarget - Monitoring target definition. +type MonitoringTarget struct { + // REQUIRED; [Required] The machine learning task type of the model. + TaskType *ModelTaskType + + // The ARM resource ID of either the deployment targeted by this monitor. + DeploymentID *string + + // The ARM resource ID of either the model targeted by this monitor. + ModelID *string +} + +type MonitoringThreshold struct { + // The threshold value. If null, the set default is dependent on the metric type. + Value *float64 +} + +// MonitoringWorkspaceConnection - Monitoring workspace connection definition. +type MonitoringWorkspaceConnection struct { + // 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. + EnvironmentVariables map[string]*string + + // 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. + Secrets map[string]*string } // Mpi - MPI distribution configuration. @@ -5673,15 +7970,6 @@ func (m *Mpi) GetDistributionConfiguration() *DistributionConfiguration { } } -// NCrossValidationsClassification provides polymorphic access to related types. -// Call the interface's GetNCrossValidations() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoNCrossValidations, *CustomNCrossValidations, *NCrossValidations -type NCrossValidationsClassification interface { - // GetNCrossValidations returns the NCrossValidations content of the underlying type. - GetNCrossValidations() *NCrossValidations -} - // NCrossValidations - N-Cross validations value. type NCrossValidations struct { // REQUIRED; [Required] Mode for determining N-Cross validations. @@ -5691,14 +7979,92 @@ type NCrossValidations struct { // GetNCrossValidations implements the NCrossValidationsClassification interface for type NCrossValidations. func (n *NCrossValidations) GetNCrossValidations() *NCrossValidations { return n } +// NlpFixedParameters - Fixed training parameters that won't be swept over during AutoML NLP training. +type NlpFixedParameters struct { + // Number of steps to accumulate gradients over before running a backward pass. + GradientAccumulationSteps *int32 + + // The learning rate for the training procedure. + LearningRate *float32 + + // The type of learning rate schedule to use during the training procedure. + LearningRateScheduler *NlpLearningRateScheduler + + // The name of the model to train. + ModelName *string + + // Number of training epochs. + NumberOfEpochs *int32 + + // The batch size for the training procedure. + TrainingBatchSize *int32 + + // The batch size to be used during evaluation. + ValidationBatchSize *int32 + + // The warmup ratio, used alongside LrSchedulerType. + WarmupRatio *float32 + + // The weight decay for the training procedure. + WeightDecay *float32 +} + +// NlpParameterSubspace - Stringified search spaces for each parameter. See below examples. +type NlpParameterSubspace struct { + // Number of steps to accumulate gradients over before running a backward pass. + GradientAccumulationSteps *string + + // The learning rate for the training procedure. + LearningRate *string + + // The type of learning rate schedule to use during the training procedure. + LearningRateScheduler *string + + // The name of the model to train. + ModelName *string + + // Number of training epochs. + NumberOfEpochs *string + + // The batch size for the training procedure. + TrainingBatchSize *string + + // The batch size to be used during evaluation. + ValidationBatchSize *string + + // The warmup ratio, used alongside LrSchedulerType. + WarmupRatio *string + + // The weight decay for the training procedure. + WeightDecay *string +} + +// NlpSweepSettings - Model sweeping and hyperparameter tuning related settings. +type NlpSweepSettings struct { + // REQUIRED; [Required] Type of sampling algorithm. + SamplingAlgorithm *SamplingAlgorithmType + + // Type of early termination policy for the sweeping job. + EarlyTermination EarlyTerminationPolicyClassification +} + // NlpVertical - Abstract class for NLP related AutoML tasks. NLP - Natural Language Processing. type NlpVertical struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *NlpVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *NlpFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *NlpVerticalLimitSettings + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*NlpParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *NlpSweepSettings + // Validation data inputs. ValidationData *MLTableJobInput } @@ -5713,11 +8079,17 @@ type NlpVerticalLimitSettings struct { // Maximum Concurrent AutoML iterations. MaxConcurrentTrials *int32 + // Maximum nodes to use for the experiment. + MaxNodes *int32 + // Number of AutoML iterations. MaxTrials *int32 // AutoML job timeout. Timeout *string + + // Timeout for individual HD trials. + TrialTimeout *string } // NodeStateCounts - Counts of various compute node states on the amlCompute. @@ -5741,29 +8113,44 @@ type NodeStateCounts struct { UnusableNodeCount *int32 } +// Nodes - Abstract Nodes definition +type Nodes struct { + // REQUIRED; [Required] Type of the Nodes value + NodesValueType *NodesValueType +} + +// GetNodes implements the NodesClassification interface for type Nodes. +func (n *Nodes) GetNodes() *Nodes { return n } + type NoneAuthTypeWorkspaceConnectionProperties struct { // REQUIRED; Authentication type of the connection target AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Target *string + Category *ConnectionCategory + ExpiryTime *time.Time - // Value details of the workspace connection. - Value *string + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string - // format for the workspace connection value - ValueFormat *ValueFormat + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type NoneAuthTypeWorkspaceConnectionProperties. func (n *NoneAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { return &WorkspaceConnectionPropertiesV2{ - AuthType: n.AuthType, - Category: n.Category, - Target: n.Target, - Value: n.Value, - ValueFormat: n.ValueFormat, + AuthType: n.AuthType, + Category: n.Category, + CreatedByWorkspaceArmID: n.CreatedByWorkspaceArmID, + ExpiryTime: n.ExpiryTime, + IsSharedToAll: n.IsSharedToAll, + Metadata: n.Metadata, + Target: n.Target, } } @@ -5812,7 +8199,8 @@ type NotebookPreparationError struct { } type NotebookResourceInfo struct { - Fqdn *string + Fqdn *string + IsPrivateLinkEnabled *bool // The error that occurs when preparing notebook. NotebookPreparationError *NotebookPreparationError @@ -5821,13 +8209,144 @@ type NotebookResourceInfo struct { ResourceID *string } -// Objective - Optimization objective. -type Objective struct { - // REQUIRED; [Required] Defines supported metric goals for hyperparameter tuning - Goal *Goal +// NotificationSetting - Configuration for notification. +type NotificationSetting struct { + // Send email notification to user on specified notification type + EmailOn []*EmailNotificationEnableType + + // This is the email recipient list which has a limitation of 499 characters in total concat with comma separator + Emails []*string + + // Send webhook callback to a service. Key is a user-provided name for the webhook. + Webhooks map[string]WebhookClassification +} + +type NumericalDataDriftMetricThreshold struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // REQUIRED; [Required] The numerical data drift metric to calculate. + Metric *NumericalDataDriftMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetDataDriftMetricThresholdBase implements the DataDriftMetricThresholdBaseClassification interface for type NumericalDataDriftMetricThreshold. +func (n *NumericalDataDriftMetricThreshold) GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase { + return &DataDriftMetricThresholdBase{ + DataType: n.DataType, + Threshold: n.Threshold, + } +} + +type NumericalDataQualityMetricThreshold struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // REQUIRED; [Required] The numerical data quality metric to calculate. + Metric *NumericalDataQualityMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetDataQualityMetricThresholdBase implements the DataQualityMetricThresholdBaseClassification interface for type NumericalDataQualityMetricThreshold. +func (n *NumericalDataQualityMetricThreshold) GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase { + return &DataQualityMetricThresholdBase{ + DataType: n.DataType, + Threshold: n.Threshold, + } +} + +type NumericalPredictionDriftMetricThreshold struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType + + // REQUIRED; [Required] The numerical prediction drift metric to calculate. + Metric *NumericalPredictionDriftMetric + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetPredictionDriftMetricThresholdBase implements the PredictionDriftMetricThresholdBaseClassification interface for type +// NumericalPredictionDriftMetricThreshold. +func (n *NumericalPredictionDriftMetricThreshold) GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase { + return &PredictionDriftMetricThresholdBase{ + DataType: n.DataType, + Threshold: n.Threshold, + } +} + +// Objective - Optimization objective. +type Objective struct { + // REQUIRED; [Required] Defines supported metric goals for hyperparameter tuning + Goal *Goal + + // REQUIRED; [Required] Name of the metric to optimize. + PrimaryMetric *string +} + +// OneLakeArtifact - OneLake artifact (data source) configuration. +type OneLakeArtifact struct { + // REQUIRED; [Required] OneLake artifact name + ArtifactName *string + + // REQUIRED; [Required] OneLake artifact type + ArtifactType *OneLakeArtifactType +} + +// GetOneLakeArtifact implements the OneLakeArtifactClassification interface for type OneLakeArtifact. +func (o *OneLakeArtifact) GetOneLakeArtifact() *OneLakeArtifact { return o } + +// OneLakeDatastore - OneLake (Trident) datastore configuration. +type OneLakeDatastore struct { + // REQUIRED; [Required] OneLake artifact backing the datastore. + Artifact OneLakeArtifactClassification + + // REQUIRED; [Required] Account credentials. + Credentials DatastoreCredentialsClassification + + // REQUIRED; [Required] Storage type backing the datastore. + DatastoreType *DatastoreType + + // REQUIRED; [Required] OneLake workspace name. + OneLakeWorkspaceName *string + + // The asset description text. + Description *string + + // OneLake endpoint to use for the datastore. + Endpoint *string + + // Intellectual Property details. + IntellectualProperty *IntellectualProperty + + // The asset property dictionary. + Properties map[string]*string + + // Indicates which identity to use to authenticate service data access to customer's storage. + ServiceDataAccessAuthIdentity *ServiceDataAccessAuthIdentity + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Readonly property to indicate if datastore is the workspace default datastore + IsDefault *bool +} - // REQUIRED; [Required] Name of the metric to optimize. - PrimaryMetric *string +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type OneLakeDatastore. +func (o *OneLakeDatastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: o.Credentials, + DatastoreType: o.DatastoreType, + Description: o.Description, + IntellectualProperty: o.IntellectualProperty, + IsDefault: o.IsDefault, + Properties: o.Properties, + Tags: o.Tags, + } } type OnlineDeployment struct { @@ -5862,15 +8381,6 @@ type OnlineDeployment struct { Type *string } -// OnlineDeploymentPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetOnlineDeploymentProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *KubernetesOnlineDeployment, *ManagedOnlineDeployment, *OnlineDeploymentProperties -type OnlineDeploymentPropertiesClassification interface { - // GetOnlineDeploymentProperties returns the OnlineDeploymentProperties content of the underlying type. - GetOnlineDeploymentProperties() *OnlineDeploymentProperties -} - type OnlineDeploymentProperties struct { // REQUIRED; [Required] The compute type of the endpoint. EndpointComputeType *EndpointComputeType @@ -5881,13 +8391,16 @@ type OnlineDeploymentProperties struct { // Code configuration for the endpoint deployment. CodeConfiguration *CodeConfiguration + // The mdc configuration, we disable mdc when it's null. + DataCollector *DataCollector + // Description of the endpoint deployment. Description *string // If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. EgressPublicNetworkAccess *EgressPublicNetworkAccessType - // ARM resource ID or AssetId of the environment specification for the endpoint deployment. + // ARM resource ID of the environment specification for the endpoint deployment. EnvironmentID *string // Environment variables configuration for the deployment. @@ -5937,56 +8450,6 @@ type OnlineDeploymentTrackedResourceArmPaginatedResult struct { Value []*OnlineDeployment } -// OnlineDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginCreateOrUpdate -// method. -type OnlineDeploymentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OnlineDeploymentsClientBeginDeleteOptions contains the optional parameters for the OnlineDeploymentsClient.BeginDelete -// method. -type OnlineDeploymentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OnlineDeploymentsClientBeginUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginUpdate -// method. -type OnlineDeploymentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OnlineDeploymentsClientGetLogsOptions contains the optional parameters for the OnlineDeploymentsClient.GetLogs method. -type OnlineDeploymentsClientGetLogsOptions struct { - // placeholder for future optional parameters -} - -// OnlineDeploymentsClientGetOptions contains the optional parameters for the OnlineDeploymentsClient.Get method. -type OnlineDeploymentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// OnlineDeploymentsClientListOptions contains the optional parameters for the OnlineDeploymentsClient.NewListPager method. -type OnlineDeploymentsClientListOptions struct { - // Ordering of list. - OrderBy *string - // Continuation token for pagination. - Skip *string - // Top of list. - Top *int32 -} - -// OnlineDeploymentsClientListSKUsOptions contains the optional parameters for the OnlineDeploymentsClient.NewListSKUsPager -// method. -type OnlineDeploymentsClientListSKUsOptions struct { - // Number of Skus to be retrieved in a page of results. - Count *int32 - // Continuation token for pagination. - Skip *string -} - type OnlineEndpoint struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -6035,6 +8498,10 @@ type OnlineEndpointProperties struct { // retrieved using the ListKeys API. Keys *EndpointAuthKeys + // Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost + // 50. + MirrorTraffic map[string]*int32 + // Property dictionary. Properties can be added, but not removed or altered. Properties map[string]*string @@ -6063,65 +8530,22 @@ type OnlineEndpointTrackedResourceArmPaginatedResult struct { Value []*OnlineEndpoint } -// OnlineEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginCreateOrUpdate -// method. -type OnlineEndpointsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OnlineEndpointsClientBeginDeleteOptions contains the optional parameters for the OnlineEndpointsClient.BeginDelete method. -type OnlineEndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OnlineEndpointsClientBeginRegenerateKeysOptions contains the optional parameters for the OnlineEndpointsClient.BeginRegenerateKeys -// method. -type OnlineEndpointsClientBeginRegenerateKeysOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OnlineEndpointsClientBeginUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginUpdate method. -type OnlineEndpointsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// OnlineInferenceConfiguration - Online inference configuration options. +type OnlineInferenceConfiguration struct { + // Additional configurations + Configurations map[string]*string -// OnlineEndpointsClientGetOptions contains the optional parameters for the OnlineEndpointsClient.Get method. -type OnlineEndpointsClientGetOptions struct { - // placeholder for future optional parameters -} + // Entry script or command to invoke. + EntryScript *string -// OnlineEndpointsClientGetTokenOptions contains the optional parameters for the OnlineEndpointsClient.GetToken method. -type OnlineEndpointsClientGetTokenOptions struct { - // placeholder for future optional parameters -} + // The route to check the liveness of the inference server container. + LivenessRoute *Route -// OnlineEndpointsClientListKeysOptions contains the optional parameters for the OnlineEndpointsClient.ListKeys method. -type OnlineEndpointsClientListKeysOptions struct { - // placeholder for future optional parameters -} + // The route to check the readiness of the inference server container. + ReadinessRoute *Route -// OnlineEndpointsClientListOptions contains the optional parameters for the OnlineEndpointsClient.NewListPager method. -type OnlineEndpointsClientListOptions struct { - // EndpointComputeType to be filtered by. - ComputeType *EndpointComputeType - // Number of endpoints to be retrieved in a page of results. - Count *int32 - // Name of the endpoint. - Name *string - // The option to order the response. - OrderBy *OrderString - // A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties - // key=value Example: propKey1,propKey2,propKey3=value3 . - Properties *string - // Continuation token for pagination. - Skip *string - // A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: - // tagKey1,tagKey2,tagKey3=value3 . - Tags *string + // The port to send the scoring requests to, within the inference server container. + ScoringRoute *Route } // OnlineRequestSettings - Online deployment scoring requests configuration. @@ -6136,15 +8560,6 @@ type OnlineRequestSettings struct { RequestTimeout *string } -// OnlineScaleSettingsClassification provides polymorphic access to related types. -// Call the interface's GetOnlineScaleSettings() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DefaultScaleSettings, *OnlineScaleSettings, *TargetUtilizationScaleSettings -type OnlineScaleSettingsClassification interface { - // GetOnlineScaleSettings returns the OnlineScaleSettings content of the underlying type. - GetOnlineScaleSettings() *OnlineScaleSettings -} - // OnlineScaleSettings - Online deployment scaling configuration. type OnlineScaleSettings struct { // REQUIRED; [Required] Type of deployment scaling algorithm @@ -6154,9 +8569,110 @@ type OnlineScaleSettings struct { // GetOnlineScaleSettings implements the OnlineScaleSettingsClassification interface for type OnlineScaleSettings. func (o *OnlineScaleSettings) GetOnlineScaleSettings() *OnlineScaleSettings { return o } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + +// OsPatchingStatus - Returns metadata about the os patching. +type OsPatchingStatus struct { + // Time of the latest os patching. + LatestPatchTime *string + + // The os patching status. + PatchStatus *PatchStatus + + // Specifies whether this compute instance is pending for reboot to finish os patching. + RebootPending *bool + + // Time of scheduled reboot. + ScheduledRebootTime *string +} + +// OutboundRule - Outbound rule for the managed network of a machine learning workspace. +type OutboundRule struct { + // REQUIRED; Type of a managed network outbound rule of a machine learning workspace. + Type *RuleType + + // Category of a managed network outbound rule of a machine learning workspace. + Category *RuleCategory + + // Type of a managed network outbound rule of a machine learning workspace. + Status *RuleStatus +} + +// GetOutboundRule implements the OutboundRuleClassification interface for type OutboundRule. +func (o *OutboundRule) GetOutboundRule() *OutboundRule { return o } + +type OutboundRuleBasicResource struct { + // REQUIRED; Outbound Rule for the managed network of a machine learning workspace. + Properties OutboundRuleClassification + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// OutboundRuleListResult - List of outbound rules for the managed network of a machine learning workspace. +type OutboundRuleListResult struct { + // The link to the next page constructed using the continuationToken. If null, there are no additional pages. + NextLink *string + + // The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request + // the next list of machine learning workspaces. + Value []*OutboundRuleBasicResource } // OutputPathAssetReference - Reference to an asset via its path in a job output. @@ -6185,26 +8701,154 @@ type PATAuthTypeWorkspaceConnectionProperties struct { // Category of the connection Category *ConnectionCategory Credentials *WorkspaceConnectionPersonalAccessToken - Target *string + ExpiryTime *time.Time - // Value details of the workspace connection. - Value *string + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string - // format for the workspace connection value - ValueFormat *ValueFormat + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type PATAuthTypeWorkspaceConnectionProperties. func (p *PATAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { return &WorkspaceConnectionPropertiesV2{ - AuthType: p.AuthType, - Category: p.Category, - Target: p.Target, - Value: p.Value, - ValueFormat: p.ValueFormat, + AuthType: p.AuthType, + Category: p.Category, + CreatedByWorkspaceArmID: p.CreatedByWorkspaceArmID, + ExpiryTime: p.ExpiryTime, + IsSharedToAll: p.IsSharedToAll, + Metadata: p.Metadata, + Target: p.Target, + } +} + +type PackageInputPathBase struct { + // REQUIRED; [Required] Input path type for package inputs. + InputPathType *InputPathType +} + +// GetPackageInputPathBase implements the PackageInputPathBaseClassification interface for type PackageInputPathBase. +func (p *PackageInputPathBase) GetPackageInputPathBase() *PackageInputPathBase { return p } + +// PackageInputPathID - Package input path specified with a resource id. +type PackageInputPathID struct { + // REQUIRED; [Required] Input path type for package inputs. + InputPathType *InputPathType + + // Input resource id. + ResourceID *string +} + +// GetPackageInputPathBase implements the PackageInputPathBaseClassification interface for type PackageInputPathID. +func (p *PackageInputPathID) GetPackageInputPathBase() *PackageInputPathBase { + return &PackageInputPathBase{ + InputPathType: p.InputPathType, + } +} + +// PackageInputPathURL - Package input path specified as an url. +type PackageInputPathURL struct { + // REQUIRED; [Required] Input path type for package inputs. + InputPathType *InputPathType + + // Input path url. + URL *string +} + +// GetPackageInputPathBase implements the PackageInputPathBaseClassification interface for type PackageInputPathURL. +func (p *PackageInputPathURL) GetPackageInputPathBase() *PackageInputPathBase { + return &PackageInputPathBase{ + InputPathType: p.InputPathType, + } +} + +// PackageInputPathVersion - Package input path specified with name and version. +type PackageInputPathVersion struct { + // REQUIRED; [Required] Input path type for package inputs. + InputPathType *InputPathType + + // Input resource name. + ResourceName *string + + // Input resource version. + ResourceVersion *string +} + +// GetPackageInputPathBase implements the PackageInputPathBaseClassification interface for type PackageInputPathVersion. +func (p *PackageInputPathVersion) GetPackageInputPathBase() *PackageInputPathBase { + return &PackageInputPathBase{ + InputPathType: p.InputPathType, } } +// PackageRequest - Model package operation request properties. +type PackageRequest struct { + // REQUIRED; [Required] Inferencing server configurations. + InferencingServer InferencingServerClassification + + // REQUIRED; [Required] Arm ID of the target environment to be created by package operation. + TargetEnvironmentID *string + + // Base environment to start with. + BaseEnvironmentSource BaseEnvironmentSourceClassification + + // Collection of environment variables. + EnvironmentVariables map[string]*string + + // Collection of inputs. + Inputs []*ModelPackageInput + + // Model configuration including the mount mode. + ModelConfiguration *ModelConfiguration + + // Property dictionary. Properties can be added, removed, and updated. + Properties map[string]*string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string +} + +// PackageResponse - Package response returned after async package operation completes successfully. +type PackageResponse struct { + // READ-ONLY; Base environment to start with. + BaseEnvironmentSource BaseEnvironmentSourceClassification + + // READ-ONLY; Build id of the image build operation. + BuildID *string + + // READ-ONLY; Build state of the image build operation. + BuildState *PackageBuildState + + // READ-ONLY; Collection of environment variables. + EnvironmentVariables map[string]*string + + // READ-ONLY; Inferencing server configurations. + InferencingServer InferencingServerClassification + + // READ-ONLY; Collection of inputs. + Inputs []*ModelPackageInput + + // READ-ONLY; Log url of the image build operation. + LogURL *string + + // READ-ONLY; Model configuration including the mount mode. + ModelConfiguration *ModelConfiguration + + // READ-ONLY; Property dictionary. Tags can be added, removed, and updated. + Properties map[string]*string + + // READ-ONLY; Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Asset ID of the target environment created by package operation. + TargetEnvironmentID *string +} + // PaginatedComputeResourcesList - Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. type PaginatedComputeResourcesList struct { // A continuation link (absolute URI) to the next page of results in the list. @@ -6229,6 +8873,18 @@ type PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties struct { Tags map[string]*string } +// PartialJobBase - Mutable base definition for a job. +type PartialJobBase struct { + // Mutable notification setting for the job + NotificationSetting *PartialNotificationSetting +} + +// PartialJobBasePartialResource - Azure Resource Manager resource envelope strictly used in update requests. +type PartialJobBasePartialResource struct { + // Additional attributes of the entity. + Properties *PartialJobBase +} + // PartialManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) type PartialManagedServiceIdentity struct { // Managed service identity (system assigned and/or user assigned identities) @@ -6266,6 +8922,36 @@ type PartialMinimalTrackedResourceWithSKU struct { Tags map[string]*string } +// PartialMinimalTrackedResourceWithSKUAndIdentity - Strictly used in update requests. +type PartialMinimalTrackedResourceWithSKUAndIdentity struct { + // Managed service identity (system assigned and/or user assigned identities) + Identity *PartialManagedServiceIdentity + + // Sku details required for ARM contract for Autoscaling. + SKU *PartialSKU + + // Resource tags. + Tags map[string]*string +} + +// PartialNotificationSetting - Mutable configuration for notification. +type PartialNotificationSetting struct { + // Send webhook callback to a service. Key is a user-provided name for the webhook. + Webhooks map[string]WebhookClassification +} + +// PartialRegistryPartialTrackedResource - Strictly used in update requests. +type PartialRegistryPartialTrackedResource struct { + // Managed service identity (system assigned and/or user assigned identities) + Identity *RegistryPartialManagedServiceIdentity + + // Sku details required for ARM contract for Autoscaling. + SKU *PartialSKU + + // Resource tags. + Tags map[string]*string +} + // PartialSKU - Common SKU definition. type PartialSKU struct { // If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the @@ -6294,6 +8980,35 @@ type Password struct { Value *string } +type PendingUploadCredentialDto struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *PendingUploadCredentialType +} + +// GetPendingUploadCredentialDto implements the PendingUploadCredentialDtoClassification interface for type PendingUploadCredentialDto. +func (p *PendingUploadCredentialDto) GetPendingUploadCredentialDto() *PendingUploadCredentialDto { + return p +} + +type PendingUploadRequestDto struct { + // If PendingUploadId = null then random guid will be used. + PendingUploadID *string + + // TemporaryBlobReference is the only supported type + PendingUploadType *PendingUploadType +} + +type PendingUploadResponseDto struct { + // Container level read, write, list SAS + BlobReferenceForConsumption *BlobReferenceForConsumptionDto + + // ID for this upload request + PendingUploadID *string + + // TemporaryBlobReference is the only supported type + PendingUploadType *PendingUploadType +} + // PersonalComputeInstanceSettings - Settings for a personal compute instance. type PersonalComputeInstanceSettings struct { // A user explicitly assigned to a personal compute instance. @@ -6314,62 +9029,156 @@ type PipelineJob struct { // The asset description text. Description *string - // Display name of job. - DisplayName *string + // Display name of job. + DisplayName *string + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification + + // Inputs for the pipeline job. + Inputs map[string]JobInputClassification + + // Is the asset archived? + IsArchived *bool + + // Jobs construct the Pipeline Job. + Jobs map[string]any + + // Notification setting for the job + NotificationSetting *NotificationSetting + + // Outputs for the pipeline job + Outputs map[string]JobOutputClassification + + // The asset property dictionary. + Properties map[string]*string + + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService + + // Pipeline settings, for things like ContinueRunOnStepFailure etc. + Settings any + + // ARM resource ID of source job. + SourceJobID *string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Status of the job. + Status *JobStatus +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type PipelineJob. +func (p *PipelineJob) GetJobBaseProperties() *JobBaseProperties { + return &JobBaseProperties{ + ComponentID: p.ComponentID, + ComputeID: p.ComputeID, + Description: p.Description, + DisplayName: p.DisplayName, + ExperimentName: p.ExperimentName, + Identity: p.Identity, + IsArchived: p.IsArchived, + JobType: p.JobType, + NotificationSetting: p.NotificationSetting, + Properties: p.Properties, + SecretsConfiguration: p.SecretsConfiguration, + Services: p.Services, + Status: p.Status, + Tags: p.Tags, + } +} + +// PoolEnvironmentConfiguration - Environment configuration options. +type PoolEnvironmentConfiguration struct { + // ARM resource ID of the environment specification for the inference pool. + EnvironmentID *string + + // Environment variables configuration for the inference pool. + EnvironmentVariables map[string]*string + + // Liveness probe monitors the health of the container regularly. + LivenessProbe *ProbeSettings + + // Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness + // probe. + ReadinessProbe *ProbeSettings + + // This verifies whether the application within a container is started. Startup probes run before any other probe, and, unless + // it finishes successfully, disables other probes. + StartupProbe *ProbeSettings +} + +// PoolModelConfiguration - Model configuration options. +type PoolModelConfiguration struct { + // The URI path to the model. + ModelID *string +} + +type PoolStatus struct { + // Gets or sets the actual number of instances in the pool. + ActualCapacity *int32 + + // Gets or sets the actual number of groups in the pool. + GroupCount *int32 - // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. - ExperimentName *string + // Gets or sets the requested number of instances for the pool. + RequestedCapacity *int32 - // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken - // if null. - Identity IdentityConfigurationClassification + // Gets or sets the number of instances in the pool reserved by the system. + ReservedCapacity *int32 +} - // Inputs for the pipeline job. - Inputs map[string]JobInputClassification +type PredictionDriftMetricThresholdBase struct { + // REQUIRED; [Required] Specifies the data type of the metric threshold. + DataType *MonitoringFeatureDataType - // Is the asset archived? - IsArchived *bool + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} - // Jobs construct the Pipeline Job. - Jobs map[string]any +// GetPredictionDriftMetricThresholdBase implements the PredictionDriftMetricThresholdBaseClassification interface for type +// PredictionDriftMetricThresholdBase. +func (p *PredictionDriftMetricThresholdBase) GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase { + return p +} - // Outputs for the pipeline job - Outputs map[string]JobOutputClassification +type PredictionDriftMonitoringSignal struct { + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThresholds []PredictionDriftMetricThresholdBaseClassification - // The asset property dictionary. - Properties map[string]*string + // REQUIRED; [Required] The data which drift will be calculated for. + ProductionData MonitoringInputDataBaseClassification - // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - Services map[string]*JobService + // REQUIRED; [Required] The data to calculate drift against. + ReferenceData MonitoringInputDataBaseClassification - // Pipeline settings, for things like ContinueRunOnStepFailure etc. - Settings any + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType - // ARM resource ID of source job. - SourceJobID *string + // A dictionary that maps feature names to their respective data types. + FeatureDataTypeOverride map[string]*MonitoringFeatureDataType - // Tag dictionary. Tags can be added, removed, and updated. - Tags map[string]*string + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType - // READ-ONLY; Status of the job. - Status *JobStatus + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string } -// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type PipelineJob. -func (p *PipelineJob) GetJobBaseProperties() *JobBaseProperties { - return &JobBaseProperties{ - ComponentID: p.ComponentID, - ComputeID: p.ComputeID, - DisplayName: p.DisplayName, - ExperimentName: p.ExperimentName, - Identity: p.Identity, - IsArchived: p.IsArchived, - JobType: p.JobType, - Services: p.Services, - Status: p.Status, - Description: p.Description, - Properties: p.Properties, - Tags: p.Tags, +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type PredictionDriftMonitoringSignal. +func (p *PredictionDriftMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: p.NotificationTypes, + Properties: p.Properties, + SignalType: p.SignalType, } } @@ -6377,26 +9186,23 @@ func (p *PipelineJob) GetJobBaseProperties() *JobBaseProperties { type PrivateEndpoint struct { // READ-ONLY; The ARM identifier for Private Endpoint ID *string - - // READ-ONLY; The ARM identifier for Subnet resource that private endpoint links to - SubnetArmID *string } // PrivateEndpointConnection - The Private Endpoint Connection resource. type PrivateEndpointConnection struct { - // The identity of the resource. + // Managed service identity (system assigned and/or user assigned identities) Identity *ManagedServiceIdentity - // Specifies the location of the resource. + // Same as workspace location. Location *string - // Resource properties. + // Private endpoint connection properties. Properties *PrivateEndpointConnectionProperties - // The sku of the workspace. + // Optional. This field is required to be implemented by the RP because AML is supporting more than one tier SKU *SKU - // Contains resource tags defined as key/value pairs. + // Dictionary of Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -6418,57 +9224,77 @@ type PrivateEndpointConnectionListResult struct { Value []*PrivateEndpointConnection } -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +// PrivateEndpointConnectionProperties - Private endpoint connection properties. type PrivateEndpointConnectionProperties struct { - // REQUIRED; A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState + // The Private Endpoint resource. + PrivateEndpoint *WorkspacePrivateEndpointResource - // The resource of private end point. - PrivateEndpoint *PrivateEndpoint + // The connection state. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - // READ-ONLY; The provisioning state of the private endpoint connection resource. + // The current provisioning state. ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate -// method. -type PrivateEndpointConnectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// PrivateEndpointDestination - Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network +// of a machine learning workspace. +type PrivateEndpointDestination struct { + ServiceResourceID *string + SparkEnabled *bool + + // Type of a managed network Outbound Rule of a machine learning workspace. + SparkStatus *RuleStatus + SubresourceTarget *string } -// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete -// method. -type PrivateEndpointConnectionsClientDeleteOptions struct { - // placeholder for future optional parameters +// PrivateEndpointOutboundRule - Private Endpoint Outbound Rule for the managed network of a machine learning workspace. +type PrivateEndpointOutboundRule struct { + // REQUIRED; Type of a managed network outbound rule of a machine learning workspace. + Type *RuleType + + // Category of a managed network outbound rule of a machine learning workspace. + Category *RuleCategory + + // Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. + Destination *PrivateEndpointDestination + + // Type of a managed network outbound rule of a machine learning workspace. + Status *RuleStatus } -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters +// GetOutboundRule implements the OutboundRuleClassification interface for type PrivateEndpointOutboundRule. +func (p *PrivateEndpointOutboundRule) GetOutboundRule() *OutboundRule { + return &OutboundRule{ + Category: p.Category, + Status: p.Status, + Type: p.Type, + } } -// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager -// method. -type PrivateEndpointConnectionsClientListOptions struct { - // placeholder for future optional parameters +// PrivateEndpointResource - The PE network resource that is linked to this PE connection. +type PrivateEndpointResource struct { + // The subnetId that the private endpoint is connected to. + SubnetArmID *string + + // READ-ONLY; The ARM identifier for Private Endpoint + ID *string } // PrivateLinkResource - A private link resource type PrivateLinkResource struct { - // The identity of the resource. + // Managed service identity (system assigned and/or user assigned identities) Identity *ManagedServiceIdentity - // Specifies the location of the resource. + // Same as workspace location. Location *string - // Resource properties. + // Properties of a private link resource. Properties *PrivateLinkResourceProperties - // The sku of the workspace. + // Optional. This field is required to be implemented by the RP because AML is supporting more than one tier SKU *SKU - // Contains resource tags defined as key/value pairs. + // Dictionary of Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -6486,38 +9312,32 @@ type PrivateLinkResource struct { // PrivateLinkResourceListResult - A list of private link resources type PrivateLinkResourceListResult struct { - // Array of private link resources Value []*PrivateLinkResource } // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { - // The private link resource Private link DNS zone name. - RequiredZoneNames []*string - - // READ-ONLY; The private link resource group id. + // The private link resource group id. GroupID *string - // READ-ONLY; The private link resource required member names. + // The private link resource required member names. RequiredMembers []*string -} -// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. -type PrivateLinkResourcesClientListOptions struct { - // placeholder for future optional parameters + // The private link resource Private link DNS zone name. + RequiredZoneNames []*string } // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer // and provider. type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. + // Some RP chose "None". Other RPs use this for region expansion. ActionsRequired *string - // The reason for approval/rejection of the connection. + // User-defined message that, per NRP doc, may be used for approval-related message. Description *string - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus + // Connection status of the service consumer with the service provider + Status *EndpointServiceConnectionStatus } // ProbeSettings - Deployment container liveness/readiness probe configuration. @@ -6538,6 +9358,46 @@ type ProbeSettings struct { Timeout *string } +// ProgressMetrics - Progress metrics definition +type ProgressMetrics struct { + // READ-ONLY; The completed datapoint count. + CompletedDatapointCount *int64 + + // READ-ONLY; The time of last successful incremental data refresh in UTC. + IncrementalDataLastRefreshDateTime *time.Time + + // READ-ONLY; The skipped datapoint count. + SkippedDatapointCount *int64 + + // READ-ONLY; The total datapoint count. + TotalDatapointCount *int64 +} + +// PropertiesBase - Base definition for pool resources. +type PropertiesBase struct { + // Description of the resource. + Description *string + + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string +} + +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // PyTorch distribution configuration. type PyTorch struct { // REQUIRED; [Required] Specifies the type of distribution framework. @@ -6554,6 +9414,14 @@ func (p *PyTorch) GetDistributionConfiguration() *DistributionConfiguration { } } +type QueueSettings struct { + // Controls the compute job tier + JobTier *JobTier + + // Controls the priority of the job on a compute. + Priority *int32 +} + // QuotaBaseProperties - The properties for Quota update or retrieval. type QuotaBaseProperties struct { // Specifies the resource ID. @@ -6578,21 +9446,14 @@ type QuotaUpdateParameters struct { Value []*QuotaBaseProperties } -// QuotasClientListOptions contains the optional parameters for the QuotasClient.NewListPager method. -type QuotasClientListOptions struct { - // placeholder for future optional parameters -} - -// QuotasClientUpdateOptions contains the optional parameters for the QuotasClient.Update method. -type QuotasClientUpdateOptions struct { - // placeholder for future optional parameters -} - // RandomSamplingAlgorithm - Defines a Sampling Algorithm that generates values randomly type RandomSamplingAlgorithm struct { // REQUIRED; [Required] The algorithm used for generating hyperparameter values, along with configuration properties SamplingAlgorithmType *SamplingAlgorithmType + // An optional positive number or e in string format to be used as base for log based random sampling + Logbase *string + // The specific type of random algorithm Rule *RandomSamplingAlgorithmRule @@ -6607,6 +9468,56 @@ func (r *RandomSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { } } +// Ray distribution configuration. +type Ray struct { + // REQUIRED; [Required] Specifies the type of distribution framework. + DistributionType *DistributionType + + // The address of Ray head node. + Address *string + + // The port to bind the dashboard server to. + DashboardPort *int32 + + // Additional arguments passed to ray start in head node. + HeadNodeAdditionalArgs *string + + // Provide this argument to start the Ray dashboard GUI. + IncludeDashboard *bool + + // The port of the head ray process. + Port *int32 + + // Additional arguments passed to ray start in worker node. + WorkerNodeAdditionalArgs *string +} + +// GetDistributionConfiguration implements the DistributionConfigurationClassification interface for type Ray. +func (r *Ray) GetDistributionConfiguration() *DistributionConfiguration { + return &DistributionConfiguration{ + DistributionType: r.DistributionType, + } +} + +// Recurrence - The workflow trigger recurrence for ComputeStartStop schedule type. +type Recurrence struct { + // [Required] The frequency to trigger schedule. + Frequency *ComputeRecurrenceFrequency + + // [Required] Specifies schedule interval in conjunction with frequency + Interval *int32 + + // [Required] The recurrence schedule. + Schedule *ComputeRecurrenceSchedule + + // The start time in yyyy-MM-ddTHH:mm:ss format. + StartTime *string + + // Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: + // https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 + TimeZone *string +} + type RecurrenceSchedule struct { // REQUIRED; [Required] List of hours for the schedule. Hours []*int32 @@ -6665,16 +9576,153 @@ type RegenerateEndpointKeysRequest struct { KeyValue *string } +type Registry struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *RegistryProperties + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + type RegistryListCredentialsResult struct { Passwords []*Password - // READ-ONLY + // READ-ONLY; The location of the workspace ACR Location *string - // READ-ONLY + // READ-ONLY; The username of the workspace ACR Username *string } +// RegistryPartialManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type RegistryPartialManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string +} + +// RegistryPrivateEndpointConnection - Private endpoint connection definition. +type RegistryPrivateEndpointConnection struct { + // This is the private endpoint connection name created on SRP Full resource id: + // /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.MachineLearningServices/{resourceType}/{resourceName}/registryPrivateEndpointConnections/{peConnectionName} + ID *string + + // Same as workspace location. + Location *string + + // Properties of the Private Endpoint Connection + Properties *RegistryPrivateEndpointConnectionProperties +} + +// RegistryPrivateEndpointConnectionProperties - Properties of the Private Endpoint Connection +type RegistryPrivateEndpointConnectionProperties struct { + // The group ids + GroupIDs []*string + + // The PE network resource that is linked to this PE connection. + PrivateEndpoint *PrivateEndpointResource + + // One of null, "Succeeded", "Provisioning", "Failed". While not approved, it's null. + ProvisioningState *string + + // The connection state. + RegistryPrivateLinkServiceConnectionState *RegistryPrivateLinkServiceConnectionState +} + +// RegistryPrivateLinkServiceConnectionState - The connection state. +type RegistryPrivateLinkServiceConnectionState struct { + // Some RP chose "None". Other RPs use this for region expansion. + ActionsRequired *string + + // User-defined message that, per NRP doc, may be used for approval-related message. + Description *string + + // Connection status of the service consumer with the service provider + Status *EndpointServiceConnectionStatus +} + +// RegistryProperties - Details of the Registry +type RegistryProperties struct { + // Discovery URL for the Registry + DiscoveryURL *string + + // IntellectualPropertyPublisher for the registry + IntellectualPropertyPublisher *string + + // ResourceId of the managed RG if the registry has system created resources + ManagedResourceGroup *ArmResourceID + + // MLFlow Registry URI for the Registry + MlFlowRegistryURI *string + + // Is the Registry accessible from the internet? Possible values: "Enabled" or "Disabled" + PublicNetworkAccess *string + + // Details of each region the registry is in + RegionDetails []*RegistryRegionArmDetails + + // Private endpoint connections info used for pending connections in private link portal + RegistryPrivateEndpointConnections []*RegistryPrivateEndpointConnection +} + +// RegistryRegionArmDetails - Details for each region the registry is in +type RegistryRegionArmDetails struct { + // List of ACR accounts + AcrDetails []*AcrDetails + + // The location where the registry exists + Location *string + + // List of storage accounts + StorageAccountDetails []*StorageAccountDetails +} + +// RegistryTrackedResourceArmPaginatedResult - A paginated list of Registry entities. +type RegistryTrackedResourceArmPaginatedResult struct { + // The link to the next page of Registry objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type Registry. + Value []*Registry +} + // Regression task in AutoML Table vertical. type Regression struct { // REQUIRED; [Required] Task type for AutoMLJob. @@ -6689,6 +9737,9 @@ type Regression struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *TableVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *TableFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *TableVerticalLimitSettings @@ -6701,6 +9752,12 @@ type Regression struct { // Primary metric for regression task. PrimaryMetric *RegressionPrimaryMetrics + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*TableParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *TableSweepSettings + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. TargetColumnName *string @@ -6736,6 +9793,26 @@ func (r *Regression) GetAutoMLVertical() *AutoMLVertical { } } +type RegressionModelPerformanceMetricThreshold struct { + // REQUIRED; [Required] The regression model performance metric to calculate. + Metric *RegressionModelPerformanceMetric + + // REQUIRED; [Required] Specifies the data type of the metric threshold. + ModelType *MonitoringModelType + + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} + +// GetModelPerformanceMetricThresholdBase implements the ModelPerformanceMetricThresholdBaseClassification interface for type +// RegressionModelPerformanceMetricThreshold. +func (r *RegressionModelPerformanceMetricThreshold) GetModelPerformanceMetricThresholdBase() *ModelPerformanceMetricThresholdBase { + return &ModelPerformanceMetricThresholdBase{ + ModelType: r.ModelType, + Threshold: r.Threshold, + } +} + // RegressionTrainingSettings - Regression Training related configuration. type RegressionTrainingSettings struct { // Allowed models for regression task. @@ -6766,6 +9843,34 @@ type RegressionTrainingSettings struct { // Stack ensemble settings for stack ensemble run. StackEnsembleSettings *StackEnsembleSettings + + // 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. + TrainingMode *TrainingMode +} + +// RequestConfiguration - Scoring requests configuration. +type RequestConfiguration struct { + // The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. + MaxConcurrentRequestsPerInstance *int32 + + // The scoring timeout in ISO 8601 format. Defaults to 5000ms. + RequestTimeout *string +} + +type RequestLogging struct { + // For payload logging, we only collect payload by default. If customers also want to collect the specified headers, they + // can set them in captureHeaders so that backend will collect those headers along + // with payload. + CaptureHeaders []*string +} + +// ResizeSchema - Schema for Compute Instance resize. +type ResizeSchema struct { + // The name of the virtual machine size. + TargetVMSize *string } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources @@ -6801,6 +9906,13 @@ type ResourceConfiguration struct { // Optional type of VM used as supported by the compute target. InstanceType *string + // Locations where the job can run. + Locations []*string + + // 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. + MaxInstanceCount *int32 + // Additional properties bag. Properties map[string]any } @@ -6825,20 +9937,58 @@ type ResourceQuota struct { // READ-ONLY; Region of the AML workspace in the id. AmlWorkspaceLocation *string - // READ-ONLY; Specifies the resource ID. - ID *string + // READ-ONLY; Specifies the resource ID. + ID *string + + // READ-ONLY; The maximum permitted quota of the resource. + Limit *int64 + + // READ-ONLY; Name of the resource. + Name *ResourceName + + // READ-ONLY; Specifies the resource type. + Type *string + + // READ-ONLY; An enum describing the unit of quota measurement. + Unit *QuotaUnit +} + +// RollingInputData - Rolling input data definition. +type RollingInputData struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + InputDataType *MonitoringInputDataType + + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType + + // REQUIRED; [Required] Input Asset URI. + URI *string + + // REQUIRED; [Required] The time offset between the end of the data window and the monitor's current run time. + WindowOffset *string - // READ-ONLY; The maximum permitted quota of the resource. - Limit *int64 + // REQUIRED; [Required] The size of the trailing data window. + WindowSize *string - // READ-ONLY; Name of the resource. - Name *ResourceName + // Mapping of column names to special uses. + Columns map[string]*string - // READ-ONLY; Specifies the resource type. - Type *string + // The context metadata of the data source. + DataContext *string - // READ-ONLY; An enum describing the unit of quota measurement. - Unit *QuotaUnit + // The ARM resource ID of the component resource used to preprocess the data. + PreprocessingComponentID *string +} + +// GetMonitoringInputDataBase implements the MonitoringInputDataBaseClassification interface for type RollingInputData. +func (r *RollingInputData) GetMonitoringInputDataBase() *MonitoringInputDataBase { + return &MonitoringInputDataBase{ + Columns: r.Columns, + DataContext: r.DataContext, + InputDataType: r.InputDataType, + JobInputType: r.JobInputType, + URI: r.URI, + } } type Route struct { @@ -6856,23 +10006,60 @@ type SASAuthTypeWorkspaceConnectionProperties struct { // Category of the connection Category *ConnectionCategory Credentials *WorkspaceConnectionSharedAccessSignature - Target *string + ExpiryTime *time.Time - // Value details of the workspace connection. - Value *string + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string - // format for the workspace connection value - ValueFormat *ValueFormat + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type SASAuthTypeWorkspaceConnectionProperties. func (s *SASAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { return &WorkspaceConnectionPropertiesV2{ - AuthType: s.AuthType, - Category: s.Category, - Target: s.Target, - Value: s.Value, - ValueFormat: s.ValueFormat, + AuthType: s.AuthType, + Category: s.Category, + CreatedByWorkspaceArmID: s.CreatedByWorkspaceArmID, + ExpiryTime: s.ExpiryTime, + IsSharedToAll: s.IsSharedToAll, + Metadata: s.Metadata, + Target: s.Target, + } +} + +// SASCredential - Access with full SAS uri +type SASCredential struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *DataReferenceCredentialType + + // Full SAS Uri, including the storage, container/blob path and SAS token + SasURI *string +} + +// GetDataReferenceCredential implements the DataReferenceCredentialClassification interface for type SASCredential. +func (s *SASCredential) GetDataReferenceCredential() *DataReferenceCredential { + return &DataReferenceCredential{ + CredentialType: s.CredentialType, + } +} + +type SASCredentialDto struct { + // REQUIRED; [Required] Credential type used to authentication with storage. + CredentialType *PendingUploadCredentialType + + // Full SAS Uri, including the storage, container/blob path and SAS token + SasURI *string +} + +// GetPendingUploadCredentialDto implements the PendingUploadCredentialDtoClassification interface for type SASCredentialDto. +func (s *SASCredentialDto) GetPendingUploadCredentialDto() *PendingUploadCredentialDto { + return &PendingUploadCredentialDto{ + CredentialType: s.CredentialType, } } @@ -6963,15 +10150,6 @@ type SSLConfiguration struct { Status *SSLConfigStatus } -// SamplingAlgorithmClassification provides polymorphic access to related types. -// Call the interface's GetSamplingAlgorithm() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *BayesianSamplingAlgorithm, *GridSamplingAlgorithm, *RandomSamplingAlgorithm, *SamplingAlgorithm -type SamplingAlgorithmClassification interface { - // GetSamplingAlgorithm returns the SamplingAlgorithm content of the underlying type. - GetSamplingAlgorithm() *SamplingAlgorithm -} - // SamplingAlgorithm - The Sampling Algorithm used to generate hyperparameter values, along with properties to configure the // algorithm type SamplingAlgorithm struct { @@ -7050,15 +10228,6 @@ type Schedule struct { Type *string } -// ScheduleActionBaseClassification provides polymorphic access to related types. -// Call the interface's GetScheduleActionBase() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EndpointScheduleAction, *JobScheduleAction, *ScheduleActionBase -type ScheduleActionBaseClassification interface { - // GetScheduleActionBase returns the ScheduleActionBase content of the underlying type. - GetScheduleActionBase() *ScheduleActionBase -} - type ScheduleActionBase struct { // REQUIRED; [Required] Specifies the action type of the schedule ActionType *ScheduleActionType @@ -7114,32 +10283,6 @@ type ScheduleResourceArmPaginatedResult struct { Value []*Schedule } -// SchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SchedulesClient.BeginCreateOrUpdate -// method. -type SchedulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SchedulesClientBeginDeleteOptions contains the optional parameters for the SchedulesClient.BeginDelete method. -type SchedulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SchedulesClientGetOptions contains the optional parameters for the SchedulesClient.Get method. -type SchedulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SchedulesClientListOptions contains the optional parameters for the SchedulesClient.NewListPager method. -type SchedulesClientListOptions struct { - // Status filter for schedule. - ListViewType *ScheduleListViewType - // Continuation token for pagination. - Skip *string -} - // ScriptReference - Script reference type ScriptReference struct { // Optional command line arguments passed to the script to run. @@ -7148,7 +10291,7 @@ type ScriptReference struct { // The location of scripts in the mounted volume. ScriptData *string - // The storage source of the script: workspace. + // The storage source of the script: inline, workspace. ScriptSource *string // Optional time period passed to timeout command. @@ -7164,15 +10307,6 @@ type ScriptsToExecute struct { StartupScript *ScriptReference } -// SeasonalityClassification provides polymorphic access to related types. -// Call the interface's GetSeasonality() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoSeasonality, *CustomSeasonality, *Seasonality -type SeasonalityClassification interface { - // GetSeasonality returns the Seasonality content of the underlying type. - GetSeasonality() *Seasonality -} - // Seasonality - Forecasting seasonality. type Seasonality struct { // REQUIRED; [Required] Seasonality mode. @@ -7182,11 +10316,149 @@ type Seasonality struct { // GetSeasonality implements the SeasonalityClassification interface for type Seasonality. func (s *Seasonality) GetSeasonality() *Seasonality { return s } +// SecretConfiguration - Secret Configuration definition. +type SecretConfiguration struct { + // Secret Uri. Sample Uri : https://myvault.vault.azure.net/secrets/mysecretname/secretversion + URI *string + + // Name of secret in workspace key vault. + WorkspaceSecretName *string +} + +type ServerlessComputeSettings struct { + // The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed + ServerlessComputeCustomSubnet *string + + // The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace + // with private endpoint + ServerlessComputeNoPublicIP *bool +} + +type ServerlessEndpoint struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; [Required] Additional attributes of the entity. + Properties *ServerlessEndpointProperties + + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + + // Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + Kind *string + + // Sku details required for ARM contract for Autoscaling. + SKU *SKU + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +type ServerlessEndpointCapacityReservation struct { + // REQUIRED; [Required] Specifies a capacity reservation group ID to allocate capacity from. + CapacityReservationGroupID *string + + // Specifies a capacity amount to reserve for this endpoint within the parent capacity reservation group. + EndpointReservedCapacity *int32 +} + +type ServerlessEndpointProperties struct { + // REQUIRED; [Required] The publisher-defined Serverless Offer to provision the endpoint with. + Offer *ServerlessOffer + + // Specifies the authentication mode for the Serverless endpoint. + AuthMode *ServerlessInferenceEndpointAuthMode + + // Optional capacity reservation information for the endpoint. When specified, the Serverless Endpoint will be allocated capacity + // from the specified capacity reservation group. + CapacityReservation *ServerlessEndpointCapacityReservation + + // READ-ONLY; The inference uri to target when making requests against the serverless endpoint + InferenceEndpoint *ServerlessInferenceEndpoint + + // READ-ONLY; Provisioning state for the endpoint. + ProvisioningState *EndpointProvisioningState +} + +type ServerlessEndpointStatus struct { + // READ-ONLY; The model-specific metrics from the backing inference endpoint. + Metrics map[string]*string +} + +// ServerlessEndpointTrackedResourceArmPaginatedResult - A paginated list of ServerlessEndpoint entities. +type ServerlessEndpointTrackedResourceArmPaginatedResult struct { + // The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. + NextLink *string + + // An array of objects of type ServerlessEndpoint. + Value []*ServerlessEndpoint +} + +type ServerlessInferenceEndpoint struct { + // REQUIRED; [Required] The inference uri to target when making requests against the Serverless Endpoint. + URI *string + + // READ-ONLY; Specifies any required headers to target this serverless endpoint. + Headers map[string]*string +} + +type ServerlessOffer struct { + // REQUIRED; [Required] The name of the Serverless Offer + OfferName *string + + // REQUIRED; [Required] Publisher name of the Serverless Offer + Publisher *string +} + type ServiceManagedResourcesSettings struct { - // The settings for the service managed cosmosdb account. CosmosDb *CosmosDbSettings } +type ServicePrincipalAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + Credentials *WorkspaceConnectionServicePrincipal + ExpiryTime *time.Time + + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string + + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type ServicePrincipalAuthTypeWorkspaceConnectionProperties. +func (s *ServicePrincipalAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: s.AuthType, + Category: s.Category, + CreatedByWorkspaceArmID: s.CreatedByWorkspaceArmID, + ExpiryTime: s.ExpiryTime, + IsSharedToAll: s.IsSharedToAll, + Metadata: s.Metadata, + Target: s.Target, + } +} + // ServicePrincipalDatastoreCredentials - Service Principal datastore credentials configuration. type ServicePrincipalDatastoreCredentials struct { // REQUIRED; [Required] Service principal client ID. @@ -7231,6 +10503,43 @@ func (s *ServicePrincipalDatastoreSecrets) GetDatastoreSecrets() *DatastoreSecre } } +// ServiceTagDestination - Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning +// workspace. +type ServiceTagDestination struct { + // The action enum for networking rule. + Action *RuleAction + PortRanges *string + Protocol *string + ServiceTag *string + + // READ-ONLY; Optional, if provided, the ServiceTag property will be ignored. + AddressPrefixes []*string +} + +// ServiceTagOutboundRule - Service Tag Outbound Rule for the managed network of a machine learning workspace. +type ServiceTagOutboundRule struct { + // REQUIRED; Type of a managed network outbound rule of a machine learning workspace. + Type *RuleType + + // Category of a managed network outbound rule of a machine learning workspace. + Category *RuleCategory + + // Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + Destination *ServiceTagDestination + + // Type of a managed network outbound rule of a machine learning workspace. + Status *RuleStatus +} + +// GetOutboundRule implements the OutboundRuleClassification interface for type ServiceTagOutboundRule. +func (s *ServiceTagOutboundRule) GetOutboundRule() *OutboundRule { + return &OutboundRule{ + Category: s.Category, + Status: s.Status, + Type: s.Type, + } +} + // SetupScripts - Details of customized scripts to execute for setting up the cluster. type SetupScripts struct { // Customized setup scripts @@ -7238,26 +10547,181 @@ type SetupScripts struct { } type SharedPrivateLinkResource struct { - // Unique name of the private link. + // Unique name of the private link Name *string - // Resource properties. + // Properties of a shared private link resource. Properties *SharedPrivateLinkResourceProperty } // SharedPrivateLinkResourceProperty - Properties of a shared private link resource. type SharedPrivateLinkResourceProperty struct { - // The private link resource group id. + // group id of the private link GroupID *string - // The resource id that private link links to. + // the resource id that private link links to PrivateLinkResourceID *string - // Request message. + // Request message RequestMessage *string - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus + // Connection status of the service consumer with the service provider + Status *EndpointServiceConnectionStatus +} + +// SparkJob - Spark job definition. +type SparkJob struct { + // REQUIRED; [Required] ARM resource ID of the code asset. + CodeID *string + + // REQUIRED; [Required] The entry to execute on startup of the job. + Entry SparkJobEntryClassification + + // REQUIRED; [Required] Specifies the type of job. + JobType *JobType + + // Archive files used in the job. + Archives []*string + + // Arguments for the job. + Args *string + + // ARM resource ID of the component resource. + ComponentID *string + + // ARM resource ID of the compute resource. + ComputeID *string + + // Spark configured properties. + Conf map[string]*string + + // The asset description text. + Description *string + + // Display name of job. + DisplayName *string + + // The ARM resource ID of the Environment specification for the job. + EnvironmentID *string + + // Environment variables included in the job. + EnvironmentVariables map[string]*string + + // The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + ExperimentName *string + + // Files used in the job. + Files []*string + + // Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. Defaults to AmlToken + // if null. + Identity IdentityConfigurationClassification + + // Mapping of input data bindings used in the job. + Inputs map[string]JobInputClassification + + // Is the asset archived? + IsArchived *bool + + // Jar files used in the job. + Jars []*string + + // Notification setting for the job + NotificationSetting *NotificationSetting + + // Mapping of output data bindings used in the job. + Outputs map[string]JobOutputClassification + + // The asset property dictionary. + Properties map[string]*string + + // Python files used in the job. + PyFiles []*string + + // Queue settings for the job + QueueSettings *QueueSettings + + // Compute Resource configuration for the job. + Resources *SparkResourceConfiguration + + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + Services map[string]*JobService + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string + + // READ-ONLY; Status of the job. + Status *JobStatus +} + +// GetJobBaseProperties implements the JobBasePropertiesClassification interface for type SparkJob. +func (s *SparkJob) GetJobBaseProperties() *JobBaseProperties { + return &JobBaseProperties{ + ComponentID: s.ComponentID, + ComputeID: s.ComputeID, + Description: s.Description, + DisplayName: s.DisplayName, + ExperimentName: s.ExperimentName, + Identity: s.Identity, + IsArchived: s.IsArchived, + JobType: s.JobType, + NotificationSetting: s.NotificationSetting, + Properties: s.Properties, + SecretsConfiguration: s.SecretsConfiguration, + Services: s.Services, + Status: s.Status, + Tags: s.Tags, + } +} + +// SparkJobEntry - Spark job entry point definition. +type SparkJobEntry struct { + // REQUIRED; [Required] Type of the job's entry point. + SparkJobEntryType *SparkJobEntryType +} + +// GetSparkJobEntry implements the SparkJobEntryClassification interface for type SparkJobEntry. +func (s *SparkJobEntry) GetSparkJobEntry() *SparkJobEntry { return s } + +type SparkJobPythonEntry struct { + // REQUIRED; [Required] Relative python file path for job entry point. + File *string + + // REQUIRED; [Required] Type of the job's entry point. + SparkJobEntryType *SparkJobEntryType +} + +// GetSparkJobEntry implements the SparkJobEntryClassification interface for type SparkJobPythonEntry. +func (s *SparkJobPythonEntry) GetSparkJobEntry() *SparkJobEntry { + return &SparkJobEntry{ + SparkJobEntryType: s.SparkJobEntryType, + } +} + +type SparkJobScalaEntry struct { + // REQUIRED; [Required] Scala class name used as entry point. + ClassName *string + + // REQUIRED; [Required] Type of the job's entry point. + SparkJobEntryType *SparkJobEntryType +} + +// GetSparkJobEntry implements the SparkJobEntryClassification interface for type SparkJobScalaEntry. +func (s *SparkJobScalaEntry) GetSparkJobEntry() *SparkJobEntry { + return &SparkJobEntry{ + SparkJobEntryType: s.SparkJobEntryType, + } +} + +type SparkResourceConfiguration struct { + // Optional type of VM used as supported by the compute target. + InstanceType *string + + // Version of spark runtime used for the job. + RuntimeVersion *string } // StackEnsembleSettings - Advances setting to customize StackEnsemble run. @@ -7273,6 +10737,68 @@ type StackEnsembleSettings struct { StackMetaLearnerType *StackMetaLearnerType } +// StaticInputData - Static input data definition. +type StaticInputData struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + InputDataType *MonitoringInputDataType + + // REQUIRED; [Required] Specifies the type of job. + JobInputType *JobInputType + + // REQUIRED; [Required] Input Asset URI. + URI *string + + // REQUIRED; [Required] The end date of the data window. + WindowEnd *time.Time + + // REQUIRED; [Required] The start date of the data window. + WindowStart *time.Time + + // Mapping of column names to special uses. + Columns map[string]*string + + // The context metadata of the data source. + DataContext *string + + // The ARM resource ID of the component resource used to preprocess the data. + PreprocessingComponentID *string +} + +// GetMonitoringInputDataBase implements the MonitoringInputDataBaseClassification interface for type StaticInputData. +func (s *StaticInputData) GetMonitoringInputDataBase() *MonitoringInputDataBase { + return &MonitoringInputDataBase{ + Columns: s.Columns, + DataContext: s.DataContext, + InputDataType: s.InputDataType, + JobInputType: s.JobInputType, + URI: s.URI, + } +} + +// StatusMessage - Active message associated with project +type StatusMessage struct { + // READ-ONLY; Service-defined message code. + Code *string + + // READ-ONLY; Time in UTC at which the message was created. + CreatedDateTime *time.Time + + // READ-ONLY; Severity level of message. + Level *StatusMessageLevel + + // READ-ONLY; A human-readable representation of the message code. + Message *string +} + +// StorageAccountDetails - Details of storage account to be used for the Registry +type StorageAccountDetails struct { + // Details of system created storage account to be used for the registry + SystemCreatedStorageAccount *SystemCreatedStorageAccount + + // Details of user created storage account to be used for the registry + UserCreatedStorageAccount *UserCreatedStorageAccount +} + // SweepJob - Sweep job definition. type SweepJob struct { // REQUIRED; [Required] Specifies the type of job. @@ -7291,6 +10817,9 @@ type SweepJob struct { // REQUIRED; [Required] Trial component definition. Trial *TrialComponent + // Component Configuration for sweep over component + ComponentConfiguration *ComponentConfiguration + // ARM resource ID of the component resource. ComponentID *string @@ -7322,12 +10851,24 @@ type SweepJob struct { // Sweep Job limit. Limits *SweepJobLimits + // Notification setting for the job + NotificationSetting *NotificationSetting + // Mapping of output data bindings used in the job. Outputs map[string]JobOutputClassification // The asset property dictionary. Properties map[string]*string + // Queue settings for the job + QueueSettings *QueueSettings + + // Compute Resource configuration for the job. + Resources *JobResourceConfiguration + + // Configuration for secrets to be made available during runtime. + SecretsConfiguration map[string]*SecretConfiguration + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. Services map[string]*JobService @@ -7341,18 +10882,20 @@ type SweepJob struct { // GetJobBaseProperties implements the JobBasePropertiesClassification interface for type SweepJob. func (s *SweepJob) GetJobBaseProperties() *JobBaseProperties { return &JobBaseProperties{ - ComponentID: s.ComponentID, - ComputeID: s.ComputeID, - DisplayName: s.DisplayName, - ExperimentName: s.ExperimentName, - Identity: s.Identity, - IsArchived: s.IsArchived, - JobType: s.JobType, - Services: s.Services, - Status: s.Status, - Description: s.Description, - Properties: s.Properties, - Tags: s.Tags, + ComponentID: s.ComponentID, + ComputeID: s.ComputeID, + Description: s.Description, + DisplayName: s.DisplayName, + ExperimentName: s.ExperimentName, + Identity: s.Identity, + IsArchived: s.IsArchived, + JobType: s.JobType, + NotificationSetting: s.NotificationSetting, + Properties: s.Properties, + SecretsConfiguration: s.SecretsConfiguration, + Services: s.Services, + Status: s.Status, + Tags: s.Tags, } } @@ -7421,16 +10964,16 @@ type SynapseSpark struct { // GetCompute implements the ComputeClassification interface for type SynapseSpark. func (s *SynapseSpark) GetCompute() *Compute { return &Compute{ - ComputeType: s.ComputeType, ComputeLocation: s.ComputeLocation, - ProvisioningState: s.ProvisioningState, - Description: s.Description, + ComputeType: s.ComputeType, CreatedOn: s.CreatedOn, + Description: s.Description, + DisableLocalAuth: s.DisableLocalAuth, + IsAttachedCompute: s.IsAttachedCompute, ModifiedOn: s.ModifiedOn, - ResourceID: s.ResourceID, ProvisioningErrors: s.ProvisioningErrors, - IsAttachedCompute: s.IsAttachedCompute, - DisableLocalAuth: s.DisableLocalAuth, + ProvisioningState: s.ProvisioningState, + ResourceID: s.ResourceID, } } @@ -7466,6 +11009,35 @@ type SynapseSparkProperties struct { WorkspaceName *string } +type SystemCreatedAcrAccount struct { + // Name of the ACR account + AcrAccountName *string + + // SKU of the ACR account + AcrAccountSKU *string + + // This is populated once the ACR account is created. + ArmResourceID *ArmResourceID +} + +type SystemCreatedStorageAccount struct { + // Public blob access allowed + AllowBlobPublicAccess *bool + + // This is populated once the storage account is created. + ArmResourceID *ArmResourceID + + // HNS enabled for storage account + StorageAccountHnsEnabled *bool + + // Name of the storage account + StorageAccountName *string + + // Allowed values: "StandardLRS", "StandardGRS", "StandardRAGRS", "StandardZRS", "StandardGZRS", "StandardRAGZRS", "PremiumLRS", + // "PremiumZRS" + StorageAccountType *string +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -7499,6 +11071,139 @@ type SystemService struct { Version *string } +// TableFixedParameters - Fixed training parameters that won't be swept over during AutoML Table training. +type TableFixedParameters struct { + // Specify the boosting type, e.g gbdt for XGBoost. + Booster *string + + // Specify the boosting type, e.g gbdt for LightGBM. + BoostingType *string + + // Specify the grow policy, which controls the way new nodes are added to the tree. + GrowPolicy *string + + // The learning rate for the training procedure. + LearningRate *float64 + + // Specify the Maximum number of discrete bins to bucket continuous features . + MaxBin *int32 + + // Specify the max depth to limit the tree depth explicitly. + MaxDepth *int32 + + // Specify the max leaves to limit the tree leaves explicitly. + MaxLeaves *int32 + + // The minimum number of data per leaf. + MinDataInLeaf *int32 + + // Minimum loss reduction required to make a further partition on a leaf node of the tree. + MinSplitGain *float64 + + // The name of the model to train. + ModelName *string + + // Specify the number of trees (or rounds) in an model. + NEstimators *int32 + + // Specify the number of leaves. + NumLeaves *int32 + + // The name of the preprocessor to use. + PreprocessorName *string + + // L1 regularization term on weights. + RegAlpha *float64 + + // L2 regularization term on weights. + RegLambda *float64 + + // Subsample ratio of the training instance. + Subsample *float64 + + // Frequency of subsample. + SubsampleFreq *float64 + + // Specify the tree method. + TreeMethod *string + + // If true, center before scaling the data with StandardScalar. + WithMean *bool + + // If true, scaling the data with Unit Variance with StandardScalar. + WithStd *bool +} + +type TableParameterSubspace struct { + // Specify the boosting type, e.g gbdt for XGBoost. + Booster *string + + // Specify the boosting type, e.g gbdt for LightGBM. + BoostingType *string + + // Specify the grow policy, which controls the way new nodes are added to the tree. + GrowPolicy *string + + // The learning rate for the training procedure. + LearningRate *string + + // Specify the Maximum number of discrete bins to bucket continuous features . + MaxBin *string + + // Specify the max depth to limit the tree depth explicitly. + MaxDepth *string + + // Specify the max leaves to limit the tree leaves explicitly. + MaxLeaves *string + + // The minimum number of data per leaf. + MinDataInLeaf *string + + // Minimum loss reduction required to make a further partition on a leaf node of the tree. + MinSplitGain *string + + // The name of the model to train. + ModelName *string + + // Specify the number of trees (or rounds) in an model. + NEstimators *string + + // Specify the number of leaves. + NumLeaves *string + + // The name of the preprocessor to use. + PreprocessorName *string + + // L1 regularization term on weights. + RegAlpha *string + + // L2 regularization term on weights. + RegLambda *string + + // Subsample ratio of the training instance. + Subsample *string + + // Frequency of subsample + SubsampleFreq *string + + // Specify the tree method. + TreeMethod *string + + // If true, center before scaling the data with StandardScalar. + WithMean *string + + // If true, scaling the data with Unit Variance with StandardScalar. + WithStd *string +} + +type TableSweepSettings struct { + // REQUIRED; [Required] Type of sampling algorithm. + SamplingAlgorithm *SamplingAlgorithmType + + // Type of early termination policy for the sweeping job. + EarlyTermination EarlyTerminationPolicyClassification +} + // TableVertical - Abstract class for AutoML tasks that use table dataset as input - such as Classification/Regression/Forecasting. type TableVertical struct { // Columns to use for CVSplit data. @@ -7507,12 +11212,21 @@ type TableVertical struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *TableVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *TableFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *TableVerticalLimitSettings // Number of cross validation folds to be applied on training dataset when validation dataset is not provided. NCrossValidations NCrossValidationsClassification + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*TableParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *TableSweepSettings + // Test data input. TestData *MLTableJobInput @@ -7571,9 +11285,18 @@ type TableVerticalLimitSettings struct { // Max cores per iteration. MaxCoresPerTrial *int32 + // Maximum nodes to use for the experiment. + MaxNodes *int32 + // Number of iterations. MaxTrials *int32 + // Number of concurrent sweeping runs that user wants to trigger. + SweepConcurrentTrials *int32 + + // Number of sweeping runs that user wants to trigger. + SweepTrials *int32 + // AutoML job timeout. Timeout *string @@ -7581,15 +11304,6 @@ type TableVerticalLimitSettings struct { TrialTimeout *string } -// TargetLagsClassification provides polymorphic access to related types. -// Call the interface's GetTargetLags() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoTargetLags, *CustomTargetLags, *TargetLags -type TargetLagsClassification interface { - // GetTargetLags returns the TargetLags content of the underlying type. - GetTargetLags() *TargetLags -} - // TargetLags - The number of past periods to lag from the target column. type TargetLags struct { // REQUIRED; [Required] Set target lags mode - Auto/Custom @@ -7599,15 +11313,6 @@ type TargetLags struct { // GetTargetLags implements the TargetLagsClassification interface for type TargetLags. func (t *TargetLags) GetTargetLags() *TargetLags { return t } -// TargetRollingWindowSizeClassification provides polymorphic access to related types. -// Call the interface's GetTargetRollingWindowSize() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutoTargetRollingWindowSize, *CustomTargetRollingWindowSize, *TargetRollingWindowSize -type TargetRollingWindowSizeClassification interface { - // GetTargetRollingWindowSize returns the TargetRollingWindowSize content of the underlying type. - GetTargetRollingWindowSize() *TargetRollingWindowSize -} - // TargetRollingWindowSize - Forecasting target rolling window size. type TargetRollingWindowSize struct { // REQUIRED; [Required] TargetRollingWindowSiz detection mode. @@ -7671,6 +11376,9 @@ type TextClassification struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *NlpVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *NlpFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *NlpVerticalLimitSettings @@ -7680,6 +11388,12 @@ type TextClassification struct { // Primary metric for Text-Classification task. PrimaryMetric *ClassificationPrimaryMetrics + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*NlpParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *NlpSweepSettings + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. TargetColumnName *string @@ -7708,12 +11422,21 @@ type TextClassificationMultilabel struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *NlpVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *NlpFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *NlpVerticalLimitSettings // Log verbosity for the job. LogVerbosity *LogVerbosity + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*NlpParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *NlpSweepSettings + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. TargetColumnName *string @@ -7746,12 +11469,21 @@ type TextNer struct { // Featurization inputs needed for AutoML job. FeaturizationSettings *NlpVerticalFeaturizationSettings + // Model/training parameters that will remain constant throughout training. + FixedParameters *NlpFixedParameters + // Execution constraints for AutoMLJob. LimitSettings *NlpVerticalLimitSettings // Log verbosity for the job. LogVerbosity *LogVerbosity + // Search space for sampling different combinations of models and their hyperparameters. + SearchSpace []*NlpParameterSubspace + + // Settings for model sweeping and hyperparameter tuning. + SweepSettings *NlpSweepSettings + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. TargetColumnName *string @@ -7772,6 +11504,26 @@ func (t *TextNer) GetAutoMLVertical() *AutoMLVertical { } } +type TmpfsOptions struct { + // Mention the Tmpfs size + Size *int32 +} + +type TopNFeaturesByAttribution struct { + // REQUIRED; [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + FilterType *MonitoringFeatureFilterType + + // The number of top features to include. + Top *int32 +} + +// GetMonitoringFeatureFilterBase implements the MonitoringFeatureFilterBaseClassification interface for type TopNFeaturesByAttribution. +func (t *TopNFeaturesByAttribution) GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase { + return &MonitoringFeatureFilterBase{ + FilterType: t.FilterType, + } +} + // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { @@ -7818,6 +11570,12 @@ type TrainingSettings struct { // Stack ensemble settings for stack ensemble run. StackEnsembleSettings *StackEnsembleSettings + + // 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. + TrainingMode *TrainingMode } // TrialComponent - Trial component definition. @@ -7841,15 +11599,6 @@ type TrialComponent struct { Resources *JobResourceConfiguration } -// TriggerBaseClassification provides polymorphic access to related types. -// Call the interface's GetTriggerBase() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CronTrigger, *RecurrenceTrigger, *TriggerBase -type TriggerBaseClassification interface { - // GetTriggerBase returns the TriggerBase content of the underlying type. - GetTriggerBase() *TriggerBase -} - type TriggerBase struct { // REQUIRED; [Required] TriggerType *TriggerType @@ -7870,6 +11619,22 @@ type TriggerBase struct { // GetTriggerBase implements the TriggerBaseClassification interface for type TriggerBase. func (t *TriggerBase) GetTriggerBase() *TriggerBase { return t } +// TritonInferencingServer - Triton inferencing server configurations. +type TritonInferencingServer struct { + // REQUIRED; [Required] Inferencing server type for various targets. + ServerType *InferencingServerType + + // Inference configuration for Triton. + InferenceConfiguration *OnlineInferenceConfiguration +} + +// GetInferencingServer implements the InferencingServerClassification interface for type TritonInferencingServer. +func (t *TritonInferencingServer) GetInferencingServer() *InferencingServer { + return &InferencingServer{ + ServerType: t.ServerType, + } +} + type TritonModelJobInput struct { // REQUIRED; [Required] Specifies the type of job. JobInputType *JobInputType @@ -7896,6 +11661,15 @@ type TritonModelJobOutput struct { // REQUIRED; [Required] Specifies the type of job. JobOutputType *JobOutputType + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Description for the output. Description *string @@ -7944,21 +11718,31 @@ type URIFileDataVersion struct { // REQUIRED; [Required] Specifies the type of data. DataType *DataType - // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType + // REQUIRED; [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 DataURI *string + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // Intellectual Property details. Used if data is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. Properties map[string]*string + // Stage in the data lifecycle assigned to this data asset + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string } @@ -7966,13 +11750,16 @@ type URIFileDataVersion struct { // GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type URIFileDataVersion. func (u *URIFileDataVersion) GetDataVersionBaseProperties() *DataVersionBaseProperties { return &DataVersionBaseProperties{ - DataType: u.DataType, - DataURI: u.DataURI, - IsAnonymous: u.IsAnonymous, - IsArchived: u.IsArchived, - Description: u.Description, - Properties: u.Properties, - Tags: u.Tags, + AutoDeleteSetting: u.AutoDeleteSetting, + DataType: u.DataType, + DataURI: u.DataURI, + Description: u.Description, + IntellectualProperty: u.IntellectualProperty, + IsAnonymous: u.IsAnonymous, + IsArchived: u.IsArchived, + Properties: u.Properties, + Stage: u.Stage, + Tags: u.Tags, } } @@ -8002,6 +11789,15 @@ type URIFileJobOutput struct { // REQUIRED; [Required] Specifies the type of job. JobOutputType *JobOutputType + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Description for the output. Description *string @@ -8025,21 +11821,31 @@ type URIFolderDataVersion struct { // REQUIRED; [Required] Specifies the type of data. DataType *DataType - // REQUIRED; [Required] Uri of the data. Usage/meaning depends on Microsoft.MachineLearning.ManagementFrontEnd.Contracts.V20221001.Assets.DataVersionBase.DataType + // REQUIRED; [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330 DataURI *string + // Specifies the lifecycle setting of managed data asset. + AutoDeleteSetting *AutoDeleteSetting + // The asset description text. Description *string - // If the name version are system generated (anonymous registration). + // Intellectual Property details. Used if data is an Intellectual Property. + IntellectualProperty *IntellectualProperty + + // 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 IsAnonymous *bool - // Is the asset archived? + // Is the asset archived? For types where Stage is defined, when Stage is provided it will be used to populate IsArchived IsArchived *bool // The asset property dictionary. Properties map[string]*string + // Stage in the data lifecycle assigned to this data asset + Stage *string + // Tag dictionary. Tags can be added, removed, and updated. Tags map[string]*string } @@ -8047,13 +11853,16 @@ type URIFolderDataVersion struct { // GetDataVersionBaseProperties implements the DataVersionBasePropertiesClassification interface for type URIFolderDataVersion. func (u *URIFolderDataVersion) GetDataVersionBaseProperties() *DataVersionBaseProperties { return &DataVersionBaseProperties{ - DataType: u.DataType, - DataURI: u.DataURI, - IsAnonymous: u.IsAnonymous, - IsArchived: u.IsArchived, - Description: u.Description, - Properties: u.Properties, - Tags: u.Tags, + AutoDeleteSetting: u.AutoDeleteSetting, + DataType: u.DataType, + DataURI: u.DataURI, + Description: u.Description, + IntellectualProperty: u.IntellectualProperty, + IsAnonymous: u.IsAnonymous, + IsArchived: u.IsArchived, + Properties: u.Properties, + Stage: u.Stage, + Tags: u.Tags, } } @@ -8083,6 +11892,15 @@ type URIFolderJobOutput struct { // REQUIRED; [Required] Specifies the type of job. JobOutputType *JobOutputType + // Output Asset Name. + AssetName *string + + // Output Asset Version. + AssetVersion *string + + // Auto delete setting of output data asset. + AutoDeleteSetting *AutoDeleteSetting + // Description for the output. Description *string @@ -8162,11 +11980,6 @@ type UsageName struct { Value *string } -// UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. -type UsagesClientListOptions struct { - // placeholder for future optional parameters -} - // UserAccountCredentials - Settings for user account that gets created on each on the nodes of a compute. type UserAccountCredentials struct { // REQUIRED; Name of the administrator user account which can be used to SSH to nodes. @@ -8188,6 +12001,16 @@ type UserAssignedIdentity struct { PrincipalID *string } +type UserCreatedAcrAccount struct { + // ARM ResourceId of a resource + ArmResourceID *ArmResourceID +} + +type UserCreatedStorageAccount struct { + // ARM ResourceId of a resource + ArmResourceID *ArmResourceID +} + // UserIdentity - User identity configuration. type UserIdentity struct { // REQUIRED; [Required] Specifies the type of identity framework. @@ -8208,23 +12031,29 @@ type UsernamePasswordAuthTypeWorkspaceConnectionProperties struct { // Category of the connection Category *ConnectionCategory Credentials *WorkspaceConnectionUsernamePassword - Target *string + ExpiryTime *time.Time - // Value details of the workspace connection. - Value *string + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string - // format for the workspace connection value - ValueFormat *ValueFormat + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type UsernamePasswordAuthTypeWorkspaceConnectionProperties. func (u *UsernamePasswordAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { return &WorkspaceConnectionPropertiesV2{ - AuthType: u.AuthType, - Category: u.Category, - Target: u.Target, - Value: u.Value, - ValueFormat: u.ValueFormat, + AuthType: u.AuthType, + Category: u.Category, + CreatedByWorkspaceArmID: u.CreatedByWorkspaceArmID, + ExpiryTime: u.ExpiryTime, + IsSharedToAll: u.IsSharedToAll, + Metadata: u.Metadata, + Target: u.Target, } } @@ -8266,16 +12095,16 @@ type VirtualMachine struct { // GetCompute implements the ComputeClassification interface for type VirtualMachine. func (v *VirtualMachine) GetCompute() *Compute { return &Compute{ - ComputeType: v.ComputeType, ComputeLocation: v.ComputeLocation, - ProvisioningState: v.ProvisioningState, - Description: v.Description, + ComputeType: v.ComputeType, CreatedOn: v.CreatedOn, + Description: v.Description, + DisableLocalAuth: v.DisableLocalAuth, + IsAttachedCompute: v.IsAttachedCompute, ModifiedOn: v.ModifiedOn, - ResourceID: v.ResourceID, ProvisioningErrors: v.ProvisioningErrors, - IsAttachedCompute: v.IsAttachedCompute, - DisableLocalAuth: v.DisableLocalAuth, + ProvisioningState: v.ProvisioningState, + ResourceID: v.ResourceID, } } @@ -8387,26 +12216,63 @@ type VirtualMachineSizeListResult struct { Value []*VirtualMachineSize } -// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List method. -type VirtualMachineSizesClientListOptions struct { - // placeholder for future optional parameters +type VolumeDefinition struct { + // Bind Options of the mount + Bind *BindOptions + + // Consistency of the volume + Consistency *string + + // Indicate whether to mount volume as readOnly. Default value for this is false. + ReadOnly *bool + + // Source of the mount. For bind mounts this is the host path. + Source *string + + // Target of the mount. For bind mounts this is the path in the container. + Target *string + + // tmpfs option of the mount + Tmpfs *TmpfsOptions + + // Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe + Type *VolumeDefinitionType + + // Volume Options of the mount + Volume *VolumeOptions +} + +type VolumeOptions struct { + // Indicate whether volume is nocopy + Nocopy *bool +} + +// Webhook base +type Webhook struct { + // REQUIRED; [Required] Specifies the type of service to send a callback + WebhookType *WebhookType + + // Send callback on a specified notification event + EventType *string } +// GetWebhook implements the WebhookClassification interface for type Webhook. +func (w *Webhook) GetWebhook() *Webhook { return w } + // Workspace - An object that represents a machine learning workspace. type Workspace struct { - // The identity of the resource. - Identity *ManagedServiceIdentity + // REQUIRED; Additional attributes of the entity. + Properties *WorkspaceProperties - // Specifies the location of the resource. + // Managed service identity (system assigned and/or user assigned identities) + Identity *ManagedServiceIdentity + Kind *string Location *string - // The properties of the machine learning workspace. - Properties *WorkspaceProperties - - // The sku of the workspace. + // Optional. This field is required to be implemented by the RP because AML is supporting more than one tier SKU *SKU - // Contains resource tags defined as key/value pairs. + // Dictionary of Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -8422,6 +12288,16 @@ type Workspace struct { Type *string } +// WorkspaceConnectionAPIKey - Api key object for workspace connection credential. +type WorkspaceConnectionAPIKey struct { + Key *string +} + +type WorkspaceConnectionAccessKey struct { + AccessKeyID *string + SecretAccessKey *string +} + type WorkspaceConnectionManagedIdentity struct { ClientID *string ResourceID *string @@ -8431,29 +12307,23 @@ type WorkspaceConnectionPersonalAccessToken struct { Pat *string } -// WorkspaceConnectionPropertiesV2Classification provides polymorphic access to related types. -// Call the interface's GetWorkspaceConnectionPropertiesV2() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ManagedIdentityAuthTypeWorkspaceConnectionProperties, *NoneAuthTypeWorkspaceConnectionProperties, *PATAuthTypeWorkspaceConnectionProperties, -// - *SASAuthTypeWorkspaceConnectionProperties, *UsernamePasswordAuthTypeWorkspaceConnectionProperties, *WorkspaceConnectionPropertiesV2 -type WorkspaceConnectionPropertiesV2Classification interface { - // GetWorkspaceConnectionPropertiesV2 returns the WorkspaceConnectionPropertiesV2 content of the underlying type. - GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 -} - type WorkspaceConnectionPropertiesV2 struct { // REQUIRED; Authentication type of the connection target AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Target *string + Category *ConnectionCategory + ExpiryTime *time.Time - // Value details of the workspace connection. - Value *string + // whether this connection will be shared to all the project workspace under the hub + IsSharedToAll *bool + + // Anything + Metadata any + Target *string - // format for the workspace connection value - ValueFormat *ValueFormat + // READ-ONLY; The arm id of the workspace which created this connection + CreatedByWorkspaceArmID *string } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type WorkspaceConnectionPropertiesV2. @@ -8479,53 +12349,40 @@ type WorkspaceConnectionPropertiesV2BasicResource struct { } type WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult struct { - Value []*WorkspaceConnectionPropertiesV2BasicResource - - // READ-ONLY NextLink *string + Value []*WorkspaceConnectionPropertiesV2BasicResource +} + +type WorkspaceConnectionServicePrincipal struct { + ClientID *string + ClientSecret *string + TenantID *string } type WorkspaceConnectionSharedAccessSignature struct { Sas *string } +// WorkspaceConnectionUpdateParameter - The properties that the machine learning workspace connection will be updated with. +type WorkspaceConnectionUpdateParameter struct { + // The properties that the machine learning workspace connection will be updated with. + Properties WorkspaceConnectionPropertiesV2Classification +} + type WorkspaceConnectionUsernamePassword struct { Password *string Username *string } -// WorkspaceConnectionsClientCreateOptions contains the optional parameters for the WorkspaceConnectionsClient.Create method. -type WorkspaceConnectionsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceConnectionsClientDeleteOptions contains the optional parameters for the WorkspaceConnectionsClient.Delete method. -type WorkspaceConnectionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceConnectionsClientGetOptions contains the optional parameters for the WorkspaceConnectionsClient.Get method. -type WorkspaceConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceConnectionsClientListOptions contains the optional parameters for the WorkspaceConnectionsClient.NewListPager -// method. -type WorkspaceConnectionsClientListOptions struct { - // Category of the workspace connection. - Category *string - // Target of the workspace connection. - Target *string -} - -// WorkspaceFeaturesClientListOptions contains the optional parameters for the WorkspaceFeaturesClient.NewListPager method. -type WorkspaceFeaturesClientListOptions struct { - // placeholder for future optional parameters +// WorkspaceHubConfig - WorkspaceHub's configuration object. +type WorkspaceHubConfig struct { + AdditionalWorkspaceStorageAccounts []*string + DefaultWorkspaceResourceGroup *string } // WorkspaceListResult - The result of a request to list machine learning workspaces. type WorkspaceListResult struct { - // The URI that can be used to request the next list of machine learning workspaces. + // The link to the next page constructed using the continuationToken. If null, there are no additional pages. NextLink *string // The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request @@ -8533,13 +12390,24 @@ type WorkspaceListResult struct { Value []*Workspace } +// WorkspacePrivateEndpointResource - The Private Endpoint resource. +type WorkspacePrivateEndpointResource struct { + // READ-ONLY; e.g. /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName} + ID *string + + // READ-ONLY; The subnetId that the private endpoint is connected to. + SubnetArmID *string +} + // WorkspaceProperties - The properties of a machine learning workspace. type WorkspaceProperties struct { // The flag to indicate whether to allow public access when behind VNet. AllowPublicAccessWhenBehindVnet *bool // ARM id of the application insights associated with this workspace. - ApplicationInsights *string + ApplicationInsights *string + AssociatedWorkspaces []*string + ContainerRegistries []*string // ARM id of the container registry associated with this workspace. ContainerRegistry *string @@ -8548,28 +12416,39 @@ type WorkspaceProperties struct { Description *string // Url for the discovery service to identify regional endpoints for machine learning experimentation services - DiscoveryURL *string + DiscoveryURL *string + EnableDataIsolation *bool + Encryption *EncryptionProperty + ExistingWorkspaces []*string - // The encryption settings of Azure ML workspace. - Encryption *EncryptionProperty + // Settings for feature store type workspace. + FeatureStoreSettings *FeatureStoreSettings // The friendly name for this workspace. This name in mutable FriendlyName *string // The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service - HbiWorkspace *bool + HbiWorkspace *bool + HubResourceID *string // The compute name for image build ImageBuildCompute *string // ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created - KeyVault *string + KeyVault *string + KeyVaults []*string + + // Managed Network settings for a machine learning workspace. + ManagedNetwork *ManagedNetworkSettings // The user assigned identity resource id that represents the workspace identity. PrimaryUserAssignedIdentity *string // Whether requests from Public Network are allowed. - PublicNetworkAccess *PublicNetworkAccess + PublicNetworkAccess *PublicNetworkAccessType + + // Settings for serverless compute created in the workspace + ServerlessComputeSettings *ServerlessComputeSettings // The service managed resource settings. ServiceManagedResourcesSettings *ServiceManagedResourcesSettings @@ -8577,12 +12456,22 @@ type WorkspaceProperties struct { // The list of shared private link resources in this workspace. SharedPrivateLinkResources []*SharedPrivateLinkResource + // Retention time in days after workspace get soft deleted. + SoftDeleteRetentionInDays *int32 + // ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created - StorageAccount *string + StorageAccount *string + StorageAccounts []*string + + // The auth mode used for accessing the system datastores of the workspace. + SystemDatastoresAuthMode *string // Enabling v1legacymode may prevent you from using features provided by the v2 API. V1LegacyMode *bool + // WorkspaceHub's configuration object. + WorkspaceHubConfig *WorkspaceHubConfig + // READ-ONLY; The URI associated with this workspace that machine learning flow must point at to set up tracking. MlFlowTrackingURI *string @@ -8613,7 +12502,7 @@ type WorkspaceProperties struct { WorkspaceID *string } -// WorkspacePropertiesUpdateParameters - The parameters for updating the properties of a machine learning workspace. +// WorkspacePropertiesUpdateParameters - The parameters for updating a machine learning workspace. type WorkspacePropertiesUpdateParameters struct { // ARM id of the application insights associated with this workspace. ApplicationInsights *string @@ -8622,122 +12511,52 @@ type WorkspacePropertiesUpdateParameters struct { ContainerRegistry *string // The description of this workspace. - Description *string + Description *string + EnableDataIsolation *bool + Encryption *EncryptionUpdateProperties - // The friendly name for this workspace. + // Settings for feature store type workspace. + FeatureStoreSettings *FeatureStoreSettings + + // The friendly name for this workspace. This name in mutable FriendlyName *string // The compute name for image build ImageBuildCompute *string + // Managed Network settings for a machine learning workspace. + ManagedNetwork *ManagedNetworkSettings + // The user assigned identity resource id that represents the workspace identity. PrimaryUserAssignedIdentity *string // Whether requests from Public Network are allowed. - PublicNetworkAccess *PublicNetworkAccess + PublicNetworkAccess *PublicNetworkAccessType + + // Settings for serverless compute created in the workspace + ServerlessComputeSettings *ServerlessComputeSettings // The service managed resource settings. ServiceManagedResourcesSettings *ServiceManagedResourcesSettings + + // Retention time in days after workspace get soft deleted. + SoftDeleteRetentionInDays *int32 + + // Enabling v1legacymode may prevent you from using features provided by the v2 API. + V1LegacyMode *bool } // WorkspaceUpdateParameters - The parameters for updating a machine learning workspace. type WorkspaceUpdateParameters struct { - // The identity of the resource. + // Managed service identity (system assigned and/or user assigned identities) Identity *ManagedServiceIdentity // The properties that the machine learning workspace will be updated with. Properties *WorkspacePropertiesUpdateParameters - // The sku of the workspace. + // Optional. This field is required to be implemented by the RP because AML is supporting more than one tier SKU *SKU // The resource tags for the machine learning workspace. Tags map[string]*string } - -// WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate -// method. -type WorkspacesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. -type WorkspacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginDiagnoseOptions contains the optional parameters for the WorkspacesClient.BeginDiagnose method. -type WorkspacesClientBeginDiagnoseOptions struct { - // The parameter of diagnosing workspace health - Parameters *DiagnoseWorkspaceParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginPrepareNotebookOptions contains the optional parameters for the WorkspacesClient.BeginPrepareNotebook -// method. -type WorkspacesClientBeginPrepareNotebookOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginResyncKeysOptions contains the optional parameters for the WorkspacesClient.BeginResyncKeys method. -type WorkspacesClientBeginResyncKeysOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. -type WorkspacesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. -type WorkspacesClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager -// method. -type WorkspacesClientListByResourceGroupOptions struct { - // Continuation token for pagination. - Skip *string -} - -// WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager -// method. -type WorkspacesClientListBySubscriptionOptions struct { - // Continuation token for pagination. - Skip *string -} - -// WorkspacesClientListKeysOptions contains the optional parameters for the WorkspacesClient.ListKeys method. -type WorkspacesClientListKeysOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListNotebookAccessTokenOptions contains the optional parameters for the WorkspacesClient.ListNotebookAccessToken -// method. -type WorkspacesClientListNotebookAccessTokenOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListNotebookKeysOptions contains the optional parameters for the WorkspacesClient.ListNotebookKeys method. -type WorkspacesClientListNotebookKeysOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the WorkspacesClient.ListOutboundNetworkDependenciesEndpoints -// method. -type WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListStorageAccountKeysOptions contains the optional parameters for the WorkspacesClient.ListStorageAccountKeys -// method. -type WorkspacesClientListStorageAccountKeysOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go b/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go index 2d236caa6255..68e107609905 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -21,11 +20,11 @@ func (a AKS) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "computeLocation", a.ComputeLocation) objectMap["computeType"] = ComputeTypeAKS - populateTimeRFC3339(objectMap, "createdOn", a.CreatedOn) + populateDateTimeRFC3339(objectMap, "createdOn", a.CreatedOn) populate(objectMap, "description", a.Description) populate(objectMap, "disableLocalAuth", a.DisableLocalAuth) populate(objectMap, "isAttachedCompute", a.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", a.ModifiedOn) + populateDateTimeRFC3339(objectMap, "modifiedOn", a.ModifiedOn) populate(objectMap, "properties", a.Properties) populate(objectMap, "provisioningErrors", a.ProvisioningErrors) populate(objectMap, "provisioningState", a.ProvisioningState) @@ -49,7 +48,7 @@ func (a *AKS) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ComputeType", &a.ComputeType) delete(rawMsg, key) case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &a.CreatedOn) + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &a.CreatedOn) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &a.Description) @@ -61,7 +60,7 @@ func (a *AKS) UnmarshalJSON(data []byte) error { err = unpopulate(val, "IsAttachedCompute", &a.IsAttachedCompute) delete(rawMsg, key) case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &a.ModifiedOn) + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &a.ModifiedOn) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) @@ -169,6 +168,116 @@ func (a *AKSSchemaProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type APIKeyAuthWorkspaceConnectionProperties. +func (a APIKeyAuthWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = ConnectionAuthTypeAPIKey + populate(objectMap, "category", a.Category) + populate(objectMap, "createdByWorkspaceArmId", a.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", a.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime) + populate(objectMap, "isSharedToAll", a.IsSharedToAll) + populateAny(objectMap, "metadata", a.Metadata) + populate(objectMap, "target", a.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIKeyAuthWorkspaceConnectionProperties. +func (a *APIKeyAuthWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authType": + err = unpopulate(val, "AuthType", &a.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &a.Category) + delete(rawMsg, key) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &a.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &a.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &a.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &a.Metadata) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessKeyAuthTypeWorkspaceConnectionProperties. +func (a AccessKeyAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = ConnectionAuthTypeAccessKey + populate(objectMap, "category", a.Category) + populate(objectMap, "createdByWorkspaceArmId", a.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", a.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime) + populate(objectMap, "isSharedToAll", a.IsSharedToAll) + populateAny(objectMap, "metadata", a.Metadata) + populate(objectMap, "target", a.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessKeyAuthTypeWorkspaceConnectionProperties. +func (a *AccessKeyAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authType": + err = unpopulate(val, "AuthType", &a.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &a.Category) + delete(rawMsg, key) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &a.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &a.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &a.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &a.Metadata) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AccountKeyDatastoreCredentials. func (a AccountKeyDatastoreCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -231,6 +340,72 @@ func (a *AccountKeyDatastoreSecrets) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AcrDetails. +func (a AcrDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "systemCreatedAcrAccount", a.SystemCreatedAcrAccount) + populate(objectMap, "userCreatedAcrAccount", a.UserCreatedAcrAccount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AcrDetails. +func (a *AcrDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "systemCreatedAcrAccount": + err = unpopulate(val, "SystemCreatedAcrAccount", &a.SystemCreatedAcrAccount) + delete(rawMsg, key) + case "userCreatedAcrAccount": + err = unpopulate(val, "UserCreatedAcrAccount", &a.UserCreatedAcrAccount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActualCapacityInfo. +func (a ActualCapacityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allocated", a.Allocated) + populate(objectMap, "assignmentFailed", a.AssignmentFailed) + populate(objectMap, "assignmentSuccess", a.AssignmentSuccess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActualCapacityInfo. +func (a *ActualCapacityInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allocated": + err = unpopulate(val, "Allocated", &a.Allocated) + delete(rawMsg, key) + case "assignmentFailed": + err = unpopulate(val, "AssignmentFailed", &a.AssignmentFailed) + delete(rawMsg, key) + case "assignmentSuccess": + err = unpopulate(val, "AssignmentSuccess", &a.AssignmentSuccess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AksComputeSecrets. func (a AksComputeSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -344,16 +519,70 @@ func (a *AksNetworkingConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AllFeatures. +func (a AllFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["filterType"] = MonitoringFeatureFilterTypeAllFeatures + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AllFeatures. +func (a *AllFeatures) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "filterType": + err = unpopulate(val, "FilterType", &a.FilterType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AllNodes. +func (a AllNodes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["nodesValueType"] = NodesValueTypeAll + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AllNodes. +func (a *AllNodes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nodesValueType": + err = unpopulate(val, "NodesValueType", &a.NodesValueType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AmlCompute. func (a AmlCompute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "computeLocation", a.ComputeLocation) objectMap["computeType"] = ComputeTypeAmlCompute - populateTimeRFC3339(objectMap, "createdOn", a.CreatedOn) + populateDateTimeRFC3339(objectMap, "createdOn", a.CreatedOn) populate(objectMap, "description", a.Description) populate(objectMap, "disableLocalAuth", a.DisableLocalAuth) populate(objectMap, "isAttachedCompute", a.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", a.ModifiedOn) + populateDateTimeRFC3339(objectMap, "modifiedOn", a.ModifiedOn) populate(objectMap, "properties", a.Properties) populate(objectMap, "provisioningErrors", a.ProvisioningErrors) populate(objectMap, "provisioningState", a.ProvisioningState) @@ -377,7 +606,7 @@ func (a *AmlCompute) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ComputeType", &a.ComputeType) delete(rawMsg, key) case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &a.CreatedOn) + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &a.CreatedOn) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &a.Description) @@ -389,7 +618,7 @@ func (a *AmlCompute) UnmarshalJSON(data []byte) error { err = unpopulate(val, "IsAttachedCompute", &a.IsAttachedCompute) delete(rawMsg, key) case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &a.ModifiedOn) + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &a.ModifiedOn) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) @@ -493,7 +722,7 @@ func (a *AmlComputeNodesInformation) UnmarshalJSON(data []byte) error { func (a AmlComputeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allocationState", a.AllocationState) - populateTimeRFC3339(objectMap, "allocationStateTransitionTime", a.AllocationStateTransitionTime) + populateDateTimeRFC3339(objectMap, "allocationStateTransitionTime", a.AllocationStateTransitionTime) populate(objectMap, "currentNodeCount", a.CurrentNodeCount) populate(objectMap, "enableNodePublicIp", a.EnableNodePublicIP) populate(objectMap, "errors", a.Errors) @@ -525,7 +754,7 @@ func (a *AmlComputeProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "AllocationState", &a.AllocationState) delete(rawMsg, key) case "allocationStateTransitionTime": - err = unpopulateTimeRFC3339(val, "AllocationStateTransitionTime", &a.AllocationStateTransitionTime) + err = unpopulateDateTimeRFC3339(val, "AllocationStateTransitionTime", &a.AllocationStateTransitionTime) delete(rawMsg, key) case "currentNodeCount": err = unpopulate(val, "CurrentNodeCount", &a.CurrentNodeCount) @@ -607,17 +836,15 @@ func (a *AmlComputeSchema) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AmlOperation. -func (a AmlOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AmlToken. +func (a AmlToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", a.Display) - populate(objectMap, "isDataAction", a.IsDataAction) - populate(objectMap, "name", a.Name) + objectMap["identityType"] = IdentityConfigurationTypeAMLToken return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AmlOperation. -func (a *AmlOperation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AmlToken. +func (a *AmlToken) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -625,14 +852,8 @@ func (a *AmlOperation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &a.Display) - delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &a.IsDataAction) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "identityType": + err = unpopulate(val, "IdentityType", &a.IdentityType) delete(rawMsg, key) } if err != nil { @@ -642,18 +863,15 @@ func (a *AmlOperation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AmlOperationDisplay. -func (a AmlOperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AmlTokenComputeIdentity. +func (a AmlTokenComputeIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", a.Description) - populate(objectMap, "operation", a.Operation) - populate(objectMap, "provider", a.Provider) - populate(objectMap, "resource", a.Resource) + objectMap["computeIdentityType"] = MonitorComputeIdentityTypeAmlToken return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AmlOperationDisplay. -func (a *AmlOperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AmlTokenComputeIdentity. +func (a *AmlTokenComputeIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -661,17 +879,8 @@ func (a *AmlOperationDisplay) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &a.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &a.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &a.Resource) + case "computeIdentityType": + err = unpopulate(val, "ComputeIdentityType", &a.ComputeIdentityType) delete(rawMsg, key) } if err != nil { @@ -681,15 +890,17 @@ func (a *AmlOperationDisplay) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AmlOperationListResult. -func (a AmlOperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AmlUserFeature. +func (a AmlUserFeature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", a.Value) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "id", a.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AmlOperationListResult. -func (a *AmlOperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AmlUserFeature. +func (a *AmlUserFeature) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -697,8 +908,14 @@ func (a *AmlOperationListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &a.Value) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) } if err != nil { @@ -708,15 +925,15 @@ func (a *AmlOperationListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AmlToken. -func (a AmlToken) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AnonymousAccessCredential. +func (a AnonymousAccessCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["identityType"] = IdentityConfigurationTypeAMLToken + objectMap["credentialType"] = DataReferenceCredentialTypeNoCredentials return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AmlToken. -func (a *AmlToken) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AnonymousAccessCredential. +func (a *AnonymousAccessCredential) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -724,8 +941,8 @@ func (a *AmlToken) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identityType": - err = unpopulate(val, "IdentityType", &a.IdentityType) + case "credentialType": + err = unpopulate(val, "CredentialType", &a.CredentialType) delete(rawMsg, key) } if err != nil { @@ -735,17 +952,15 @@ func (a *AmlToken) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AmlUserFeature. -func (a AmlUserFeature) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ArmResourceID. +func (a ArmResourceID) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "id", a.ID) + populate(objectMap, "resourceId", a.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AmlUserFeature. -func (a *AmlUserFeature) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmResourceID. +func (a *ArmResourceID) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -753,14 +968,8 @@ func (a *AmlUserFeature) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &a.ID) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) delete(rawMsg, key) } if err != nil { @@ -773,6 +982,7 @@ func (a *AmlUserFeature) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetBase. func (a AssetBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", a.AutoDeleteSetting) populate(objectMap, "description", a.Description) populate(objectMap, "isAnonymous", a.IsAnonymous) populate(objectMap, "isArchived", a.IsArchived) @@ -790,6 +1000,9 @@ func (a *AssetBase) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &a.AutoDeleteSetting) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) @@ -894,6 +1107,9 @@ func (a *AssetJobInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetJobOutput. func (a AssetJobOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "assetName", a.AssetName) + populate(objectMap, "assetVersion", a.AssetVersion) + populate(objectMap, "autoDeleteSetting", a.AutoDeleteSetting) populate(objectMap, "mode", a.Mode) populate(objectMap, "uri", a.URI) return json.Marshal(objectMap) @@ -908,6 +1124,15 @@ func (a *AssetJobOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "assetName": + err = unpopulate(val, "AssetName", &a.AssetName) + delete(rawMsg, key) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &a.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &a.AutoDeleteSetting) + delete(rawMsg, key) case "mode": err = unpopulate(val, "Mode", &a.Mode) delete(rawMsg, key) @@ -980,6 +1205,37 @@ func (a *AssignedUser) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AutoDeleteSetting. +func (a AutoDeleteSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "condition", a.Condition) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoDeleteSetting. +func (a *AutoDeleteSetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "condition": + err = unpopulate(val, "Condition", &a.Condition) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AutoForecastHorizon. func (a AutoForecastHorizon) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1020,9 +1276,12 @@ func (a AutoMLJob) MarshalJSON() ([]byte, error) { populate(objectMap, "identity", a.Identity) populate(objectMap, "isArchived", a.IsArchived) objectMap["jobType"] = JobTypeAutoML + populate(objectMap, "notificationSetting", a.NotificationSetting) populate(objectMap, "outputs", a.Outputs) populate(objectMap, "properties", a.Properties) + populate(objectMap, "queueSettings", a.QueueSettings) populate(objectMap, "resources", a.Resources) + populate(objectMap, "secretsConfiguration", a.SecretsConfiguration) populate(objectMap, "services", a.Services) populate(objectMap, "status", a.Status) populate(objectMap, "tags", a.Tags) @@ -1069,15 +1328,24 @@ func (a *AutoMLJob) UnmarshalJSON(data []byte) error { case "jobType": err = unpopulate(val, "JobType", &a.JobType) delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &a.NotificationSetting) + delete(rawMsg, key) case "outputs": a.Outputs, err = unmarshalJobOutputClassificationMap(val) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "queueSettings": + err = unpopulate(val, "QueueSettings", &a.QueueSettings) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &a.Resources) delete(rawMsg, key) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &a.SecretsConfiguration) + delete(rawMsg, key) case "services": err = unpopulate(val, "Services", &a.Services) delete(rawMsg, key) @@ -1311,24 +1579,54 @@ func (a *AutoTargetRollingWindowSize) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureBlobDatastore. -func (a AzureBlobDatastore) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutologgerSettings. +func (a AutologgerSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accountName", a.AccountName) - populate(objectMap, "containerName", a.ContainerName) - populate(objectMap, "credentials", a.Credentials) - objectMap["datastoreType"] = DatastoreTypeAzureBlob - populate(objectMap, "description", a.Description) - populate(objectMap, "endpoint", a.Endpoint) - populate(objectMap, "isDefault", a.IsDefault) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "protocol", a.Protocol) - populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) - populate(objectMap, "tags", a.Tags) + populate(objectMap, "mlflowAutologger", a.MlflowAutologger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDatastore. +// UnmarshalJSON implements the json.Unmarshaller interface for type AutologgerSettings. +func (a *AutologgerSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mlflowAutologger": + err = unpopulate(val, "MlflowAutologger", &a.MlflowAutologger) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureBlobDatastore. +func (a AzureBlobDatastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "credentials", a.Credentials) + objectMap["datastoreType"] = DatastoreTypeAzureBlob + populate(objectMap, "description", a.Description) + populate(objectMap, "endpoint", a.Endpoint) + populate(objectMap, "intellectualProperty", a.IntellectualProperty) + populate(objectMap, "isDefault", a.IsDefault) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "resourceGroup", a.ResourceGroup) + populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "subscriptionId", a.SubscriptionID) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDatastore. func (a *AzureBlobDatastore) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { @@ -1355,6 +1653,9 @@ func (a *AzureBlobDatastore) UnmarshalJSON(data []byte) error { case "endpoint": err = unpopulate(val, "Endpoint", &a.Endpoint) delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &a.IntellectualProperty) + delete(rawMsg, key) case "isDefault": err = unpopulate(val, "IsDefault", &a.IsDefault) delete(rawMsg, key) @@ -1364,9 +1665,15 @@ func (a *AzureBlobDatastore) UnmarshalJSON(data []byte) error { case "protocol": err = unpopulate(val, "Protocol", &a.Protocol) delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &a.ResourceGroup) + delete(rawMsg, key) case "serviceDataAccessAuthIdentity": err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &a.SubscriptionID) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) @@ -1384,10 +1691,13 @@ func (a AzureDataLakeGen1Datastore) MarshalJSON() ([]byte, error) { populate(objectMap, "credentials", a.Credentials) objectMap["datastoreType"] = DatastoreTypeAzureDataLakeGen1 populate(objectMap, "description", a.Description) + populate(objectMap, "intellectualProperty", a.IntellectualProperty) populate(objectMap, "isDefault", a.IsDefault) populate(objectMap, "properties", a.Properties) + populate(objectMap, "resourceGroup", a.ResourceGroup) populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) populate(objectMap, "storeName", a.StoreName) + populate(objectMap, "subscriptionId", a.SubscriptionID) populate(objectMap, "tags", a.Tags) return json.Marshal(objectMap) } @@ -1410,18 +1720,27 @@ func (a *AzureDataLakeGen1Datastore) UnmarshalJSON(data []byte) error { case "description": err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &a.IntellectualProperty) + delete(rawMsg, key) case "isDefault": err = unpopulate(val, "IsDefault", &a.IsDefault) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &a.ResourceGroup) + delete(rawMsg, key) case "serviceDataAccessAuthIdentity": err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) delete(rawMsg, key) case "storeName": err = unpopulate(val, "StoreName", &a.StoreName) delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &a.SubscriptionID) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) @@ -1442,10 +1761,13 @@ func (a AzureDataLakeGen2Datastore) MarshalJSON() ([]byte, error) { populate(objectMap, "description", a.Description) populate(objectMap, "endpoint", a.Endpoint) populate(objectMap, "filesystem", a.Filesystem) + populate(objectMap, "intellectualProperty", a.IntellectualProperty) populate(objectMap, "isDefault", a.IsDefault) populate(objectMap, "properties", a.Properties) populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "resourceGroup", a.ResourceGroup) populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "subscriptionId", a.SubscriptionID) populate(objectMap, "tags", a.Tags) return json.Marshal(objectMap) } @@ -1477,6 +1799,9 @@ func (a *AzureDataLakeGen2Datastore) UnmarshalJSON(data []byte) error { case "filesystem": err = unpopulate(val, "Filesystem", &a.Filesystem) delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &a.IntellectualProperty) + delete(rawMsg, key) case "isDefault": err = unpopulate(val, "IsDefault", &a.IsDefault) delete(rawMsg, key) @@ -1486,9 +1811,15 @@ func (a *AzureDataLakeGen2Datastore) UnmarshalJSON(data []byte) error { case "protocol": err = unpopulate(val, "Protocol", &a.Protocol) delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &a.ResourceGroup) + delete(rawMsg, key) case "serviceDataAccessAuthIdentity": err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &a.SubscriptionID) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) @@ -1500,6 +1831,68 @@ func (a *AzureDataLakeGen2Datastore) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureDatastore. +func (a AzureDatastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceGroup", a.ResourceGroup) + populate(objectMap, "subscriptionId", a.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatastore. +func (a *AzureDatastore) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &a.ResourceGroup) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &a.SubscriptionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsWebhook. +func (a AzureDevOpsWebhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eventType", a.EventType) + objectMap["webhookType"] = WebhookTypeAzureDevOps + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsWebhook. +func (a *AzureDevOpsWebhook) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eventType": + err = unpopulate(val, "EventType", &a.EventType) + delete(rawMsg, key) + case "webhookType": + err = unpopulate(val, "WebhookType", &a.WebhookType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AzureFileDatastore. func (a AzureFileDatastore) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1509,10 +1902,13 @@ func (a AzureFileDatastore) MarshalJSON() ([]byte, error) { populate(objectMap, "description", a.Description) populate(objectMap, "endpoint", a.Endpoint) populate(objectMap, "fileShareName", a.FileShareName) + populate(objectMap, "intellectualProperty", a.IntellectualProperty) populate(objectMap, "isDefault", a.IsDefault) populate(objectMap, "properties", a.Properties) populate(objectMap, "protocol", a.Protocol) + populate(objectMap, "resourceGroup", a.ResourceGroup) populate(objectMap, "serviceDataAccessAuthIdentity", a.ServiceDataAccessAuthIdentity) + populate(objectMap, "subscriptionId", a.SubscriptionID) populate(objectMap, "tags", a.Tags) return json.Marshal(objectMap) } @@ -1544,6 +1940,9 @@ func (a *AzureFileDatastore) UnmarshalJSON(data []byte) error { case "fileShareName": err = unpopulate(val, "FileShareName", &a.FileShareName) delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &a.IntellectualProperty) + delete(rawMsg, key) case "isDefault": err = unpopulate(val, "IsDefault", &a.IsDefault) delete(rawMsg, key) @@ -1553,9 +1952,15 @@ func (a *AzureFileDatastore) UnmarshalJSON(data []byte) error { case "protocol": err = unpopulate(val, "Protocol", &a.Protocol) delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &a.ResourceGroup) + delete(rawMsg, key) case "serviceDataAccessAuthIdentity": err = unpopulate(val, "ServiceDataAccessAuthIdentity", &a.ServiceDataAccessAuthIdentity) delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &a.SubscriptionID) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) delete(rawMsg, key) @@ -1567,6 +1972,68 @@ func (a *AzureFileDatastore) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureMLBatchInferencingServer. +func (a AzureMLBatchInferencingServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "codeConfiguration", a.CodeConfiguration) + objectMap["serverType"] = InferencingServerTypeAzureMLBatch + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLBatchInferencingServer. +func (a *AzureMLBatchInferencingServer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &a.CodeConfiguration) + delete(rawMsg, key) + case "serverType": + err = unpopulate(val, "ServerType", &a.ServerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureMLOnlineInferencingServer. +func (a AzureMLOnlineInferencingServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "codeConfiguration", a.CodeConfiguration) + objectMap["serverType"] = InferencingServerTypeAzureMLOnline + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLOnlineInferencingServer. +func (a *AzureMLOnlineInferencingServer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &a.CodeConfiguration) + delete(rawMsg, key) + case "serverType": + err = unpopulate(val, "ServerType", &a.ServerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BanditPolicy. func (b BanditPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1610,6 +2077,64 @@ func (b *BanditPolicy) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BaseEnvironmentID. +func (b BaseEnvironmentID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["baseEnvironmentSourceType"] = BaseEnvironmentSourceTypeEnvironmentAsset + populate(objectMap, "resourceId", b.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseEnvironmentID. +func (b *BaseEnvironmentID) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseEnvironmentSourceType": + err = unpopulate(val, "BaseEnvironmentSourceType", &b.BaseEnvironmentSourceType) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BaseEnvironmentSource. +func (b BaseEnvironmentSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["baseEnvironmentSourceType"] = b.BaseEnvironmentSourceType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseEnvironmentSource. +func (b *BaseEnvironmentSource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseEnvironmentSourceType": + err = unpopulate(val, "BaseEnvironmentSourceType", &b.BaseEnvironmentSourceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BatchDeployment. func (b BatchDeployment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1673,11 +2198,39 @@ func (b *BatchDeployment) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BatchDeploymentConfiguration. +func (b BatchDeploymentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["deploymentConfigurationType"] = b.DeploymentConfigurationType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BatchDeploymentConfiguration. +func (b *BatchDeploymentConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentConfigurationType": + err = unpopulate(val, "DeploymentConfigurationType", &b.DeploymentConfigurationType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BatchDeploymentProperties. func (b BatchDeploymentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "codeConfiguration", b.CodeConfiguration) populate(objectMap, "compute", b.Compute) + populate(objectMap, "deploymentConfiguration", b.DeploymentConfiguration) populate(objectMap, "description", b.Description) populate(objectMap, "environmentId", b.EnvironmentID) populate(objectMap, "environmentVariables", b.EnvironmentVariables) @@ -1710,6 +2263,9 @@ func (b *BatchDeploymentProperties) UnmarshalJSON(data []byte) error { case "compute": err = unpopulate(val, "Compute", &b.Compute) delete(rawMsg, key) + case "deploymentConfiguration": + b.DeploymentConfiguration, err = unmarshalBatchDeploymentConfigurationClassification(val) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &b.Description) delete(rawMsg, key) @@ -1967,6 +2523,49 @@ func (b *BatchEndpointTrackedResourceArmPaginatedResult) UnmarshalJSON(data []by return nil } +// MarshalJSON implements the json.Marshaller interface for type BatchPipelineComponentDeploymentConfiguration. +func (b BatchPipelineComponentDeploymentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "componentId", b.ComponentID) + objectMap["deploymentConfigurationType"] = BatchDeploymentConfigurationTypePipelineComponent + populate(objectMap, "description", b.Description) + populate(objectMap, "settings", b.Settings) + populate(objectMap, "tags", b.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BatchPipelineComponentDeploymentConfiguration. +func (b *BatchPipelineComponentDeploymentConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "componentId": + err = unpopulate(val, "ComponentID", &b.ComponentID) + delete(rawMsg, key) + case "deploymentConfigurationType": + err = unpopulate(val, "DeploymentConfigurationType", &b.DeploymentConfigurationType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &b.Settings) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BatchRetrySettings. func (b BatchRetrySettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2025,16 +2624,17 @@ func (b *BayesianSamplingAlgorithm) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildContext. -func (b BuildContext) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BindOptions. +func (b BindOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "contextUri", b.ContextURI) - populate(objectMap, "dockerfilePath", b.DockerfilePath) + populate(objectMap, "createHostPath", b.CreateHostPath) + populate(objectMap, "propagation", b.Propagation) + populate(objectMap, "selinux", b.Selinux) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildContext. -func (b *BuildContext) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BindOptions. +func (b *BindOptions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -2042,11 +2642,14 @@ func (b *BuildContext) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "contextUri": - err = unpopulate(val, "ContextURI", &b.ContextURI) + case "createHostPath": + err = unpopulate(val, "CreateHostPath", &b.CreateHostPath) delete(rawMsg, key) - case "dockerfilePath": - err = unpopulate(val, "DockerfilePath", &b.DockerfilePath) + case "propagation": + err = unpopulate(val, "Propagation", &b.Propagation) + delete(rawMsg, key) + case "selinux": + err = unpopulate(val, "Selinux", &b.Selinux) delete(rawMsg, key) } if err != nil { @@ -2056,112 +2659,87 @@ func (b *BuildContext) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateDatastoreCredentials. -func (c CertificateDatastoreCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BlobReferenceForConsumptionDto. +func (b BlobReferenceForConsumptionDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorityUrl", c.AuthorityURL) - populate(objectMap, "clientId", c.ClientID) - objectMap["credentialsType"] = CredentialsTypeCertificate - populate(objectMap, "resourceUrl", c.ResourceURL) - populate(objectMap, "secrets", c.Secrets) - populate(objectMap, "tenantId", c.TenantID) - populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "blobUri", b.BlobURI) + populate(objectMap, "credential", b.Credential) + populate(objectMap, "storageAccountArmId", b.StorageAccountArmID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDatastoreCredentials. -func (c *CertificateDatastoreCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobReferenceForConsumptionDto. +func (b *BlobReferenceForConsumptionDto) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "authorityUrl": - err = unpopulate(val, "AuthorityURL", &c.AuthorityURL) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &c.ClientID) - delete(rawMsg, key) - case "credentialsType": - err = unpopulate(val, "CredentialsType", &c.CredentialsType) - delete(rawMsg, key) - case "resourceUrl": - err = unpopulate(val, "ResourceURL", &c.ResourceURL) + case "blobUri": + err = unpopulate(val, "BlobURI", &b.BlobURI) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &c.Secrets) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &c.TenantID) + case "credential": + b.Credential, err = unmarshalPendingUploadCredentialDtoClassification(val) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "storageAccountArmId": + err = unpopulate(val, "StorageAccountArmID", &b.StorageAccountArmID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateDatastoreSecrets. -func (c CertificateDatastoreSecrets) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BuildContext. +func (b BuildContext) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificate", c.Certificate) - objectMap["secretsType"] = SecretsTypeCertificate + populate(objectMap, "contextUri", b.ContextURI) + populate(objectMap, "dockerfilePath", b.DockerfilePath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDatastoreSecrets. -func (c *CertificateDatastoreSecrets) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildContext. +func (b *BuildContext) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "certificate": - err = unpopulate(val, "Certificate", &c.Certificate) + case "contextUri": + err = unpopulate(val, "ContextURI", &b.ContextURI) delete(rawMsg, key) - case "secretsType": - err = unpopulate(val, "SecretsType", &c.SecretsType) + case "dockerfilePath": + err = unpopulate(val, "DockerfilePath", &b.DockerfilePath) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Classification. -func (c Classification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CSVExportSummary. +func (c CSVExportSummary) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cvSplitColumnNames", c.CvSplitColumnNames) - populate(objectMap, "featurizationSettings", c.FeaturizationSettings) - populate(objectMap, "limitSettings", c.LimitSettings) - populate(objectMap, "logVerbosity", c.LogVerbosity) - populate(objectMap, "nCrossValidations", c.NCrossValidations) - populate(objectMap, "positiveLabel", c.PositiveLabel) - populate(objectMap, "primaryMetric", c.PrimaryMetric) - populate(objectMap, "targetColumnName", c.TargetColumnName) - objectMap["taskType"] = TaskTypeClassification - populate(objectMap, "testData", c.TestData) - populate(objectMap, "testDataSize", c.TestDataSize) - populate(objectMap, "trainingData", c.TrainingData) - populate(objectMap, "trainingSettings", c.TrainingSettings) - populate(objectMap, "validationData", c.ValidationData) - populate(objectMap, "validationDataSize", c.ValidationDataSize) - populate(objectMap, "weightColumnName", c.WeightColumnName) + populate(objectMap, "containerName", c.ContainerName) + populateDateTimeRFC3339(objectMap, "endDateTime", c.EndDateTime) + populate(objectMap, "exportedRowCount", c.ExportedRowCount) + objectMap["format"] = ExportFormatTypeCSV + populate(objectMap, "labelingJobId", c.LabelingJobID) + populate(objectMap, "snapshotPath", c.SnapshotPath) + populateDateTimeRFC3339(objectMap, "startDateTime", c.StartDateTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Classification. -func (c *Classification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CSVExportSummary. +func (c *CSVExportSummary) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2169,53 +2747,26 @@ func (c *Classification) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "cvSplitColumnNames": - err = unpopulate(val, "CvSplitColumnNames", &c.CvSplitColumnNames) - delete(rawMsg, key) - case "featurizationSettings": - err = unpopulate(val, "FeaturizationSettings", &c.FeaturizationSettings) - delete(rawMsg, key) - case "limitSettings": - err = unpopulate(val, "LimitSettings", &c.LimitSettings) - delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &c.LogVerbosity) - delete(rawMsg, key) - case "nCrossValidations": - c.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) - delete(rawMsg, key) - case "positiveLabel": - err = unpopulate(val, "PositiveLabel", &c.PositiveLabel) - delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &c.PrimaryMetric) - delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &c.TargetColumnName) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &c.TaskType) - delete(rawMsg, key) - case "testData": - err = unpopulate(val, "TestData", &c.TestData) + case "containerName": + err = unpopulate(val, "ContainerName", &c.ContainerName) delete(rawMsg, key) - case "testDataSize": - err = unpopulate(val, "TestDataSize", &c.TestDataSize) + case "endDateTime": + err = unpopulateDateTimeRFC3339(val, "EndDateTime", &c.EndDateTime) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &c.TrainingData) + case "exportedRowCount": + err = unpopulate(val, "ExportedRowCount", &c.ExportedRowCount) delete(rawMsg, key) - case "trainingSettings": - err = unpopulate(val, "TrainingSettings", &c.TrainingSettings) + case "format": + err = unpopulate(val, "Format", &c.Format) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &c.ValidationData) + case "labelingJobId": + err = unpopulate(val, "LabelingJobID", &c.LabelingJobID) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &c.ValidationDataSize) + case "snapshotPath": + err = unpopulate(val, "SnapshotPath", &c.SnapshotPath) delete(rawMsg, key) - case "weightColumnName": - err = unpopulate(val, "WeightColumnName", &c.WeightColumnName) + case "startDateTime": + err = unpopulateDateTimeRFC3339(val, "StartDateTime", &c.StartDateTime) delete(rawMsg, key) } if err != nil { @@ -2225,23 +2776,24 @@ func (c *Classification) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClassificationTrainingSettings. -func (c ClassificationTrainingSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroup. +func (c CapacityReservationGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTrainingAlgorithms", c.AllowedTrainingAlgorithms) - populate(objectMap, "blockedTrainingAlgorithms", c.BlockedTrainingAlgorithms) - populate(objectMap, "enableDnnTraining", c.EnableDnnTraining) - populate(objectMap, "enableModelExplainability", c.EnableModelExplainability) - populate(objectMap, "enableOnnxCompatibleModels", c.EnableOnnxCompatibleModels) - populate(objectMap, "enableStackEnsemble", c.EnableStackEnsemble) - populate(objectMap, "enableVoteEnsemble", c.EnableVoteEnsemble) - populate(objectMap, "ensembleModelDownloadTimeout", c.EnsembleModelDownloadTimeout) - populate(objectMap, "stackEnsembleSettings", c.StackEnsembleSettings) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClassificationTrainingSettings. -func (c *ClassificationTrainingSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroup. +func (c *CapacityReservationGroup) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2249,32 +2801,35 @@ func (c *ClassificationTrainingSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "allowedTrainingAlgorithms": - err = unpopulate(val, "AllowedTrainingAlgorithms", &c.AllowedTrainingAlgorithms) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "blockedTrainingAlgorithms": - err = unpopulate(val, "BlockedTrainingAlgorithms", &c.BlockedTrainingAlgorithms) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - case "enableDnnTraining": - err = unpopulate(val, "EnableDnnTraining", &c.EnableDnnTraining) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) delete(rawMsg, key) - case "enableModelExplainability": - err = unpopulate(val, "EnableModelExplainability", &c.EnableModelExplainability) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) - case "enableOnnxCompatibleModels": - err = unpopulate(val, "EnableOnnxCompatibleModels", &c.EnableOnnxCompatibleModels) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "enableStackEnsemble": - err = unpopulate(val, "EnableStackEnsemble", &c.EnableStackEnsemble) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "enableVoteEnsemble": - err = unpopulate(val, "EnableVoteEnsemble", &c.EnableVoteEnsemble) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) - case "ensembleModelDownloadTimeout": - err = unpopulate(val, "EnsembleModelDownloadTimeout", &c.EnsembleModelDownloadTimeout) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "stackEnsembleSettings": - err = unpopulate(val, "StackEnsembleSettings", &c.StackEnsembleSettings) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -2284,15 +2839,16 @@ func (c *ClassificationTrainingSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterUpdateParameters. -func (c ClusterUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupProperties. +func (c CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "offer", c.Offer) + populate(objectMap, "reservedCapacity", c.ReservedCapacity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpdateParameters. -func (c *ClusterUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupProperties. +func (c *CapacityReservationGroupProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2300,8 +2856,11 @@ func (c *ClusterUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "offer": + err = unpopulate(val, "Offer", &c.Offer) + delete(rawMsg, key) + case "reservedCapacity": + err = unpopulate(val, "ReservedCapacity", &c.ReservedCapacity) delete(rawMsg, key) } if err != nil { @@ -2311,15 +2870,16 @@ func (c *ClusterUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterUpdateProperties. -func (c ClusterUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupTrackedResourceArmPaginatedResult. +func (c CapacityReservationGroupTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpdateProperties. -func (c *ClusterUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupTrackedResourceArmPaginatedResult. +func (c *CapacityReservationGroupTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2327,8 +2887,11 @@ func (c *ClusterUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -2338,16 +2901,17 @@ func (c *ClusterUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeConfiguration. -func (c CodeConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CategoricalDataDriftMetricThreshold. +func (c CategoricalDataDriftMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "codeId", c.CodeID) - populate(objectMap, "scoringScript", c.ScoringScript) + objectMap["dataType"] = MonitoringFeatureDataTypeCategorical + populate(objectMap, "metric", c.Metric) + populate(objectMap, "threshold", c.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeConfiguration. -func (c *CodeConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CategoricalDataDriftMetricThreshold. +func (c *CategoricalDataDriftMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2355,11 +2919,14 @@ func (c *CodeConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "codeId": - err = unpopulate(val, "CodeID", &c.CodeID) + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) delete(rawMsg, key) - case "scoringScript": - err = unpopulate(val, "ScoringScript", &c.ScoringScript) + case "metric": + err = unpopulate(val, "Metric", &c.Metric) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &c.Threshold) delete(rawMsg, key) } if err != nil { @@ -2369,19 +2936,17 @@ func (c *CodeConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeContainer. -func (c CodeContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CategoricalDataQualityMetricThreshold. +func (c CategoricalDataQualityMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + objectMap["dataType"] = MonitoringFeatureDataTypeCategorical + populate(objectMap, "metric", c.Metric) + populate(objectMap, "threshold", c.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeContainer. -func (c *CodeContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CategoricalDataQualityMetricThreshold. +func (c *CategoricalDataQualityMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2389,20 +2954,14 @@ func (c *CodeContainer) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "metric": + err = unpopulate(val, "Metric", &c.Metric) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "threshold": + err = unpopulate(val, "Threshold", &c.Threshold) delete(rawMsg, key) } if err != nil { @@ -2412,20 +2971,17 @@ func (c *CodeContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeContainerProperties. -func (c CodeContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CategoricalPredictionDriftMetricThreshold. +func (c CategoricalPredictionDriftMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - populate(objectMap, "isArchived", c.IsArchived) - populate(objectMap, "latestVersion", c.LatestVersion) - populate(objectMap, "nextVersion", c.NextVersion) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) + objectMap["dataType"] = MonitoringFeatureDataTypeCategorical + populate(objectMap, "metric", c.Metric) + populate(objectMap, "threshold", c.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeContainerProperties. -func (c *CodeContainerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CategoricalPredictionDriftMetricThreshold. +func (c *CategoricalPredictionDriftMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2433,23 +2989,14 @@ func (c *CodeContainerProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &c.IsArchived) - delete(rawMsg, key) - case "latestVersion": - err = unpopulate(val, "LatestVersion", &c.LatestVersion) - delete(rawMsg, key) - case "nextVersion": - err = unpopulate(val, "NextVersion", &c.NextVersion) + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "metric": + err = unpopulate(val, "Metric", &c.Metric) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "threshold": + err = unpopulate(val, "Threshold", &c.Threshold) delete(rawMsg, key) } if err != nil { @@ -2459,16 +3006,21 @@ func (c *CodeContainerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeContainerResourceArmPaginatedResult. -func (c CodeContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) +// MarshalJSON implements the json.Marshaller interface for type CertificateDatastoreCredentials. +func (c CertificateDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorityUrl", c.AuthorityURL) + populate(objectMap, "clientId", c.ClientID) + objectMap["credentialsType"] = CredentialsTypeCertificate + populate(objectMap, "resourceUrl", c.ResourceURL) + populate(objectMap, "secrets", c.Secrets) + populate(objectMap, "tenantId", c.TenantID) + populate(objectMap, "thumbprint", c.Thumbprint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeContainerResourceArmPaginatedResult. -func (c *CodeContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDatastoreCredentials. +func (c *CertificateDatastoreCredentials) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2476,11 +3028,26 @@ func (c *CodeContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "authorityUrl": + err = unpopulate(val, "AuthorityURL", &c.AuthorityURL) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) + delete(rawMsg, key) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &c.CredentialsType) + delete(rawMsg, key) + case "resourceUrl": + err = unpopulate(val, "ResourceURL", &c.ResourceURL) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &c.Secrets) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &c.TenantID) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) delete(rawMsg, key) } if err != nil { @@ -2490,19 +3057,16 @@ func (c *CodeContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeVersion. -func (c CodeVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CertificateDatastoreSecrets. +func (c CertificateDatastoreSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "certificate", c.Certificate) + objectMap["secretsType"] = SecretsTypeCertificate return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeVersion. -func (c *CodeVersion) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDatastoreSecrets. +func (c *CertificateDatastoreSecrets) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2510,20 +3074,11 @@ func (c *CodeVersion) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "secretsType": + err = unpopulate(val, "SecretsType", &c.SecretsType) delete(rawMsg, key) } if err != nil { @@ -2533,20 +3088,33 @@ func (c *CodeVersion) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeVersionProperties. -func (c CodeVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Classification. +func (c Classification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "codeUri", c.CodeURI) - populate(objectMap, "description", c.Description) - populate(objectMap, "isAnonymous", c.IsAnonymous) - populate(objectMap, "isArchived", c.IsArchived) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) + populate(objectMap, "cvSplitColumnNames", c.CvSplitColumnNames) + populate(objectMap, "featurizationSettings", c.FeaturizationSettings) + populate(objectMap, "fixedParameters", c.FixedParameters) + populate(objectMap, "limitSettings", c.LimitSettings) + populate(objectMap, "logVerbosity", c.LogVerbosity) + populate(objectMap, "nCrossValidations", c.NCrossValidations) + populate(objectMap, "positiveLabel", c.PositiveLabel) + populate(objectMap, "primaryMetric", c.PrimaryMetric) + populate(objectMap, "searchSpace", c.SearchSpace) + populate(objectMap, "sweepSettings", c.SweepSettings) + populate(objectMap, "targetColumnName", c.TargetColumnName) + objectMap["taskType"] = TaskTypeClassification + populate(objectMap, "testData", c.TestData) + populate(objectMap, "testDataSize", c.TestDataSize) + populate(objectMap, "trainingData", c.TrainingData) + populate(objectMap, "trainingSettings", c.TrainingSettings) + populate(objectMap, "validationData", c.ValidationData) + populate(objectMap, "validationDataSize", c.ValidationDataSize) + populate(objectMap, "weightColumnName", c.WeightColumnName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeVersionProperties. -func (c *CodeVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Classification. +func (c *Classification) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2554,23 +3122,62 @@ func (c *CodeVersionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "codeUri": - err = unpopulate(val, "CodeURI", &c.CodeURI) + case "cvSplitColumnNames": + err = unpopulate(val, "CvSplitColumnNames", &c.CvSplitColumnNames) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + case "featurizationSettings": + err = unpopulate(val, "FeaturizationSettings", &c.FeaturizationSettings) delete(rawMsg, key) - case "isAnonymous": - err = unpopulate(val, "IsAnonymous", &c.IsAnonymous) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &c.FixedParameters) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &c.IsArchived) + case "limitSettings": + err = unpopulate(val, "LimitSettings", &c.LimitSettings) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &c.LogVerbosity) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "nCrossValidations": + c.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) + delete(rawMsg, key) + case "positiveLabel": + err = unpopulate(val, "PositiveLabel", &c.PositiveLabel) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &c.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &c.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &c.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &c.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &c.TaskType) + delete(rawMsg, key) + case "testData": + err = unpopulate(val, "TestData", &c.TestData) + delete(rawMsg, key) + case "testDataSize": + err = unpopulate(val, "TestDataSize", &c.TestDataSize) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &c.TrainingData) + delete(rawMsg, key) + case "trainingSettings": + err = unpopulate(val, "TrainingSettings", &c.TrainingSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &c.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &c.ValidationDataSize) + delete(rawMsg, key) + case "weightColumnName": + err = unpopulate(val, "WeightColumnName", &c.WeightColumnName) delete(rawMsg, key) } if err != nil { @@ -2580,16 +3187,17 @@ func (c *CodeVersionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CodeVersionResourceArmPaginatedResult. -func (c CodeVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClassificationModelPerformanceMetricThreshold. +func (c ClassificationModelPerformanceMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "metric", c.Metric) + objectMap["modelType"] = MonitoringModelTypeClassification + populate(objectMap, "threshold", c.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CodeVersionResourceArmPaginatedResult. -func (c *CodeVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClassificationModelPerformanceMetricThreshold. +func (c *ClassificationModelPerformanceMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2597,11 +3205,14 @@ func (c *CodeVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "metric": + err = unpopulate(val, "Metric", &c.Metric) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "modelType": + err = unpopulate(val, "ModelType", &c.ModelType) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &c.Threshold) delete(rawMsg, key) } if err != nil { @@ -2611,16 +3222,24 @@ func (c *CodeVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ColumnTransformer. -func (c ColumnTransformer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClassificationTrainingSettings. +func (c ClassificationTrainingSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fields", c.Fields) - populateAny(objectMap, "parameters", c.Parameters) + populate(objectMap, "allowedTrainingAlgorithms", c.AllowedTrainingAlgorithms) + populate(objectMap, "blockedTrainingAlgorithms", c.BlockedTrainingAlgorithms) + populate(objectMap, "enableDnnTraining", c.EnableDnnTraining) + populate(objectMap, "enableModelExplainability", c.EnableModelExplainability) + populate(objectMap, "enableOnnxCompatibleModels", c.EnableOnnxCompatibleModels) + populate(objectMap, "enableStackEnsemble", c.EnableStackEnsemble) + populate(objectMap, "enableVoteEnsemble", c.EnableVoteEnsemble) + populate(objectMap, "ensembleModelDownloadTimeout", c.EnsembleModelDownloadTimeout) + populate(objectMap, "stackEnsembleSettings", c.StackEnsembleSettings) + populate(objectMap, "trainingMode", c.TrainingMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ColumnTransformer. -func (c *ColumnTransformer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClassificationTrainingSettings. +func (c *ClassificationTrainingSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2628,11 +3247,35 @@ func (c *ColumnTransformer) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "fields": - err = unpopulate(val, "Fields", &c.Fields) + case "allowedTrainingAlgorithms": + err = unpopulate(val, "AllowedTrainingAlgorithms", &c.AllowedTrainingAlgorithms) delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &c.Parameters) + case "blockedTrainingAlgorithms": + err = unpopulate(val, "BlockedTrainingAlgorithms", &c.BlockedTrainingAlgorithms) + delete(rawMsg, key) + case "enableDnnTraining": + err = unpopulate(val, "EnableDnnTraining", &c.EnableDnnTraining) + delete(rawMsg, key) + case "enableModelExplainability": + err = unpopulate(val, "EnableModelExplainability", &c.EnableModelExplainability) + delete(rawMsg, key) + case "enableOnnxCompatibleModels": + err = unpopulate(val, "EnableOnnxCompatibleModels", &c.EnableOnnxCompatibleModels) + delete(rawMsg, key) + case "enableStackEnsemble": + err = unpopulate(val, "EnableStackEnsemble", &c.EnableStackEnsemble) + delete(rawMsg, key) + case "enableVoteEnsemble": + err = unpopulate(val, "EnableVoteEnsemble", &c.EnableVoteEnsemble) + delete(rawMsg, key) + case "ensembleModelDownloadTimeout": + err = unpopulate(val, "EnsembleModelDownloadTimeout", &c.EnsembleModelDownloadTimeout) + delete(rawMsg, key) + case "stackEnsembleSettings": + err = unpopulate(val, "StackEnsembleSettings", &c.StackEnsembleSettings) + delete(rawMsg, key) + case "trainingMode": + err = unpopulate(val, "TrainingMode", &c.TrainingMode) delete(rawMsg, key) } if err != nil { @@ -2642,36 +3285,15 @@ func (c *ColumnTransformer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CommandJob. -func (c CommandJob) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterUpdateParameters. +func (c ClusterUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "codeId", c.CodeID) - populate(objectMap, "command", c.Command) - populate(objectMap, "componentId", c.ComponentID) - populate(objectMap, "computeId", c.ComputeID) - populate(objectMap, "description", c.Description) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "distribution", c.Distribution) - populate(objectMap, "environmentId", c.EnvironmentID) - populate(objectMap, "environmentVariables", c.EnvironmentVariables) - populate(objectMap, "experimentName", c.ExperimentName) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "inputs", c.Inputs) - populate(objectMap, "isArchived", c.IsArchived) - objectMap["jobType"] = JobTypeCommand - populate(objectMap, "limits", c.Limits) - populate(objectMap, "outputs", c.Outputs) - populateAny(objectMap, "parameters", c.Parameters) populate(objectMap, "properties", c.Properties) - populate(objectMap, "resources", c.Resources) - populate(objectMap, "services", c.Services) - populate(objectMap, "status", c.Status) - populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommandJob. -func (c *CommandJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpdateParameters. +func (c *ClusterUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2679,71 +3301,86 @@ func (c *CommandJob) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "codeId": - err = unpopulate(val, "CodeID", &c.CodeID) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &c.Command) - delete(rawMsg, key) - case "componentId": - err = unpopulate(val, "ComponentID", &c.ComponentID) - delete(rawMsg, key) - case "computeId": - err = unpopulate(val, "ComputeID", &c.ComputeID) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) - delete(rawMsg, key) - case "distribution": - c.Distribution, err = unmarshalDistributionConfigurationClassification(val) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &c.EnvironmentID) - delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) - delete(rawMsg, key) - case "experimentName": - err = unpopulate(val, "ExperimentName", &c.ExperimentName) - delete(rawMsg, key) - case "identity": - c.Identity, err = unmarshalIdentityConfigurationClassification(val) - delete(rawMsg, key) - case "inputs": - c.Inputs, err = unmarshalJobInputClassificationMap(val) - delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &c.IsArchived) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &c.JobType) - delete(rawMsg, key) - case "limits": - err = unpopulate(val, "Limits", &c.Limits) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterUpdateProperties. +func (c ClusterUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpdateProperties. +func (c *ClusterUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "outputs": - c.Outputs, err = unmarshalJobOutputClassificationMap(val) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CocoExportSummary. +func (c CocoExportSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerName", c.ContainerName) + populateDateTimeRFC3339(objectMap, "endDateTime", c.EndDateTime) + populate(objectMap, "exportedRowCount", c.ExportedRowCount) + objectMap["format"] = ExportFormatTypeCoco + populate(objectMap, "labelingJobId", c.LabelingJobID) + populate(objectMap, "snapshotPath", c.SnapshotPath) + populateDateTimeRFC3339(objectMap, "startDateTime", c.StartDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CocoExportSummary. +func (c *CocoExportSummary) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containerName": + err = unpopulate(val, "ContainerName", &c.ContainerName) delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &c.Parameters) + case "endDateTime": + err = unpopulateDateTimeRFC3339(val, "EndDateTime", &c.EndDateTime) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "exportedRowCount": + err = unpopulate(val, "ExportedRowCount", &c.ExportedRowCount) delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &c.Resources) + case "format": + err = unpopulate(val, "Format", &c.Format) delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &c.Services) + case "labelingJobId": + err = unpopulate(val, "LabelingJobID", &c.LabelingJobID) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "snapshotPath": + err = unpopulate(val, "SnapshotPath", &c.SnapshotPath) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "startDateTime": + err = unpopulateDateTimeRFC3339(val, "StartDateTime", &c.StartDateTime) delete(rawMsg, key) } if err != nil { @@ -2753,16 +3390,16 @@ func (c *CommandJob) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CommandJobLimits. -func (c CommandJobLimits) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeConfiguration. +func (c CodeConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["jobLimitsType"] = JobLimitsTypeCommand - populate(objectMap, "timeout", c.Timeout) + populate(objectMap, "codeId", c.CodeID) + populate(objectMap, "scoringScript", c.ScoringScript) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CommandJobLimits. -func (c *CommandJobLimits) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeConfiguration. +func (c *CodeConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2770,11 +3407,11 @@ func (c *CommandJobLimits) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "jobLimitsType": - err = unpopulate(val, "JobLimitsType", &c.JobLimitsType) + case "codeId": + err = unpopulate(val, "CodeID", &c.CodeID) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &c.Timeout) + case "scoringScript": + err = unpopulate(val, "ScoringScript", &c.ScoringScript) delete(rawMsg, key) } if err != nil { @@ -2784,8 +3421,8 @@ func (c *CommandJobLimits) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentContainer. -func (c ComponentContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeContainer. +func (c CodeContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) @@ -2795,8 +3432,8 @@ func (c ComponentContainer) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentContainer. -func (c *ComponentContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeContainer. +func (c *CodeContainer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2827,20 +3464,21 @@ func (c *ComponentContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentContainerProperties. -func (c ComponentContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeContainerProperties. +func (c CodeContainerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "isArchived", c.IsArchived) populate(objectMap, "latestVersion", c.LatestVersion) populate(objectMap, "nextVersion", c.NextVersion) populate(objectMap, "properties", c.Properties) + populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentContainerProperties. -func (c *ComponentContainerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeContainerProperties. +func (c *CodeContainerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2863,6 +3501,9 @@ func (c *ComponentContainerProperties) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) @@ -2874,16 +3515,16 @@ func (c *ComponentContainerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentContainerResourceArmPaginatedResult. -func (c ComponentContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeContainerResourceArmPaginatedResult. +func (c CodeContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentContainerResourceArmPaginatedResult. -func (c *ComponentContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeContainerResourceArmPaginatedResult. +func (c *CodeContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2905,8 +3546,8 @@ func (c *ComponentContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentVersion. -func (c ComponentVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeVersion. +func (c CodeVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) @@ -2916,8 +3557,8 @@ func (c ComponentVersion) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentVersion. -func (c *ComponentVersion) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeVersion. +func (c *CodeVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2948,20 +3589,22 @@ func (c *ComponentVersion) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentVersionProperties. -func (c ComponentVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeVersionProperties. +func (c CodeVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "componentSpec", c.ComponentSpec) + populate(objectMap, "autoDeleteSetting", c.AutoDeleteSetting) + populate(objectMap, "codeUri", c.CodeURI) populate(objectMap, "description", c.Description) populate(objectMap, "isAnonymous", c.IsAnonymous) populate(objectMap, "isArchived", c.IsArchived) populate(objectMap, "properties", c.Properties) + populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentVersionProperties. -func (c *ComponentVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeVersionProperties. +func (c *CodeVersionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2969,8 +3612,11 @@ func (c *ComponentVersionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "componentSpec": - err = unpopulate(val, "ComponentSpec", &c.ComponentSpec) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &c.AutoDeleteSetting) + delete(rawMsg, key) + case "codeUri": + err = unpopulate(val, "CodeURI", &c.CodeURI) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &c.Description) @@ -2984,6 +3630,9 @@ func (c *ComponentVersionProperties) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) @@ -2995,16 +3644,16 @@ func (c *ComponentVersionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComponentVersionResourceArmPaginatedResult. -func (c ComponentVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodeVersionResourceArmPaginatedResult. +func (c CodeVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentVersionResourceArmPaginatedResult. -func (c *ComponentVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CodeVersionResourceArmPaginatedResult. +func (c *CodeVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3026,24 +3675,18 @@ func (c *ComponentVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type Compute. -func (c Compute) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Collection. +func (c Collection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", c.ComputeLocation) - objectMap["computeType"] = c.ComputeType - populateTimeRFC3339(objectMap, "createdOn", c.CreatedOn) - populate(objectMap, "description", c.Description) - populate(objectMap, "disableLocalAuth", c.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", c.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", c.ModifiedOn) - populate(objectMap, "provisioningErrors", c.ProvisioningErrors) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "clientId", c.ClientID) + populate(objectMap, "dataCollectionMode", c.DataCollectionMode) + populate(objectMap, "dataId", c.DataID) + populate(objectMap, "samplingRate", c.SamplingRate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Compute. -func (c *Compute) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Collection. +func (c *Collection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3051,35 +3694,17 @@ func (c *Compute) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &c.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &c.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &c.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) - delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &c.IsAttachedCompute) - delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &c.ModifiedOn) + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &c.ProvisioningErrors) + case "dataCollectionMode": + err = unpopulate(val, "DataCollectionMode", &c.DataCollectionMode) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "dataId": + err = unpopulate(val, "DataID", &c.DataID) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) + case "samplingRate": + err = unpopulate(val, "SamplingRate", &c.SamplingRate) delete(rawMsg, key) } if err != nil { @@ -3089,25 +3714,16 @@ func (c *Compute) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstance. -func (c ComputeInstance) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ColumnTransformer. +func (c ColumnTransformer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", c.ComputeLocation) - objectMap["computeType"] = ComputeTypeComputeInstance - populateTimeRFC3339(objectMap, "createdOn", c.CreatedOn) - populate(objectMap, "description", c.Description) - populate(objectMap, "disableLocalAuth", c.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", c.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", c.ModifiedOn) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "provisioningErrors", c.ProvisioningErrors) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "fields", c.Fields) + populateAny(objectMap, "parameters", c.Parameters) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstance. -func (c *ComputeInstance) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ColumnTransformer. +func (c *ColumnTransformer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3115,38 +3731,138 @@ func (c *ComputeInstance) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &c.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &c.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &c.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + case "fields": + err = unpopulate(val, "Fields", &c.Fields) delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) + case "parameters": + err = unpopulate(val, "Parameters", &c.Parameters) delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &c.IsAttachedCompute) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CommandJob. +func (c CommandJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autologgerSettings", c.AutologgerSettings) + populate(objectMap, "codeId", c.CodeID) + populate(objectMap, "command", c.Command) + populate(objectMap, "componentId", c.ComponentID) + populate(objectMap, "computeId", c.ComputeID) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "distribution", c.Distribution) + populate(objectMap, "environmentId", c.EnvironmentID) + populate(objectMap, "environmentVariables", c.EnvironmentVariables) + populate(objectMap, "experimentName", c.ExperimentName) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "inputs", c.Inputs) + populate(objectMap, "isArchived", c.IsArchived) + objectMap["jobType"] = JobTypeCommand + populate(objectMap, "limits", c.Limits) + populate(objectMap, "notificationSetting", c.NotificationSetting) + populate(objectMap, "outputs", c.Outputs) + populateAny(objectMap, "parameters", c.Parameters) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "queueSettings", c.QueueSettings) + populate(objectMap, "resources", c.Resources) + populate(objectMap, "secretsConfiguration", c.SecretsConfiguration) + populate(objectMap, "services", c.Services) + populate(objectMap, "status", c.Status) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandJob. +func (c *CommandJob) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autologgerSettings": + err = unpopulate(val, "AutologgerSettings", &c.AutologgerSettings) delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &c.ModifiedOn) + case "codeId": + err = unpopulate(val, "CodeID", &c.CodeID) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &c.Command) + delete(rawMsg, key) + case "componentId": + err = unpopulate(val, "ComponentID", &c.ComponentID) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &c.ComputeID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "distribution": + c.Distribution, err = unmarshalDistributionConfigurationClassification(val) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &c.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &c.ExperimentName) + delete(rawMsg, key) + case "identity": + c.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "inputs": + c.Inputs, err = unmarshalJobInputClassificationMap(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &c.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &c.JobType) + delete(rawMsg, key) + case "limits": + err = unpopulate(val, "Limits", &c.Limits) + delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &c.NotificationSetting) + delete(rawMsg, key) + case "outputs": + c.Outputs, err = unmarshalJobOutputClassificationMap(val) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &c.Parameters) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &c.ProvisioningErrors) + case "queueSettings": + err = unpopulate(val, "QueueSettings", &c.QueueSettings) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "resources": + err = unpopulate(val, "Resources", &c.Resources) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &c.SecretsConfiguration) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &c.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { @@ -3156,16 +3872,16 @@ func (c *ComputeInstance) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceApplication. -func (c ComputeInstanceApplication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CommandJobLimits. +func (c CommandJobLimits) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "endpointUri", c.EndpointURI) + objectMap["jobLimitsType"] = JobLimitsTypeCommand + populate(objectMap, "timeout", c.Timeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceApplication. -func (c *ComputeInstanceApplication) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandJobLimits. +func (c *CommandJobLimits) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3173,11 +3889,11 @@ func (c *ComputeInstanceApplication) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) + case "jobLimitsType": + err = unpopulate(val, "JobLimitsType", &c.JobLimitsType) delete(rawMsg, key) - case "endpointUri": - err = unpopulate(val, "EndpointURI", &c.EndpointURI) + case "timeout": + err = unpopulate(val, "Timeout", &c.Timeout) delete(rawMsg, key) } if err != nil { @@ -3187,16 +3903,15 @@ func (c *ComputeInstanceApplication) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceConnectivityEndpoints. -func (c ComputeInstanceConnectivityEndpoints) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentConfiguration. +func (c ComponentConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateIpAddress", c.PrivateIPAddress) - populate(objectMap, "publicIpAddress", c.PublicIPAddress) + populateAny(objectMap, "pipelineSettings", c.PipelineSettings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceConnectivityEndpoints. -func (c *ComputeInstanceConnectivityEndpoints) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentConfiguration. +func (c *ComponentConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3204,11 +3919,8 @@ func (c *ComputeInstanceConnectivityEndpoints) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "privateIpAddress": - err = unpopulate(val, "PrivateIPAddress", &c.PrivateIPAddress) - delete(rawMsg, key) - case "publicIpAddress": - err = unpopulate(val, "PublicIPAddress", &c.PublicIPAddress) + case "pipelineSettings": + err = unpopulate(val, "PipelineSettings", &c.PipelineSettings) delete(rawMsg, key) } if err != nil { @@ -3218,20 +3930,19 @@ func (c *ComputeInstanceConnectivityEndpoints) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceContainer. -func (c ComputeInstanceContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentContainer. +func (c ComponentContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autosave", c.Autosave) - populate(objectMap, "environment", c.Environment) - populate(objectMap, "gpu", c.Gpu) + populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) - populate(objectMap, "network", c.Network) - populate(objectMap, "services", c.Services) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceContainer. -func (c *ComputeInstanceContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentContainer. +func (c *ComponentContainer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3239,23 +3950,20 @@ func (c *ComputeInstanceContainer) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "autosave": - err = unpopulate(val, "Autosave", &c.Autosave) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &c.Environment) - delete(rawMsg, key) - case "gpu": - err = unpopulate(val, "Gpu", &c.Gpu) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "network": - err = unpopulate(val, "Network", &c.Network) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &c.Services) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -3265,17 +3973,21 @@ func (c *ComputeInstanceContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceCreatedBy. -func (c ComputeInstanceCreatedBy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentContainerProperties. +func (c ComponentContainerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "userId", c.UserID) - populate(objectMap, "userName", c.UserName) - populate(objectMap, "userOrgId", c.UserOrgID) + populate(objectMap, "description", c.Description) + populate(objectMap, "isArchived", c.IsArchived) + populate(objectMap, "latestVersion", c.LatestVersion) + populate(objectMap, "nextVersion", c.NextVersion) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceCreatedBy. -func (c *ComputeInstanceCreatedBy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentContainerProperties. +func (c *ComponentContainerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3283,14 +3995,26 @@ func (c *ComputeInstanceCreatedBy) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "userId": - err = unpopulate(val, "UserID", &c.UserID) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &c.UserName) + case "isArchived": + err = unpopulate(val, "IsArchived", &c.IsArchived) delete(rawMsg, key) - case "userOrgId": - err = unpopulate(val, "UserOrgID", &c.UserOrgID) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &c.LatestVersion) + delete(rawMsg, key) + case "nextVersion": + err = unpopulate(val, "NextVersion", &c.NextVersion) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { @@ -3300,18 +4024,16 @@ func (c *ComputeInstanceCreatedBy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceDataDisk. -func (c ComputeInstanceDataDisk) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentContainerResourceArmPaginatedResult. +func (c ComponentContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "caching", c.Caching) - populate(objectMap, "diskSizeGB", c.DiskSizeGB) - populate(objectMap, "lun", c.Lun) - populate(objectMap, "storageAccountType", c.StorageAccountType) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceDataDisk. -func (c *ComputeInstanceDataDisk) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentContainerResourceArmPaginatedResult. +func (c *ComponentContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3319,17 +4041,11 @@ func (c *ComputeInstanceDataDisk) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "caching": - err = unpopulate(val, "Caching", &c.Caching) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &c.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &c.Lun) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &c.StorageAccountType) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -3339,23 +4055,19 @@ func (c *ComputeInstanceDataDisk) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceDataMount. -func (c ComputeInstanceDataMount) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentVersion. +func (c ComponentVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "createdBy", c.CreatedBy) - populate(objectMap, "error", c.Error) - populate(objectMap, "mountAction", c.MountAction) - populate(objectMap, "mountName", c.MountName) - populate(objectMap, "mountPath", c.MountPath) - populate(objectMap, "mountState", c.MountState) - populateTimeRFC3339(objectMap, "mountedOn", c.MountedOn) - populate(objectMap, "source", c.Source) - populate(objectMap, "sourceType", c.SourceType) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceDataMount. -func (c *ComputeInstanceDataMount) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentVersion. +func (c *ComponentVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3363,32 +4075,20 @@ func (c *ComputeInstanceDataMount) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createdBy": - err = unpopulate(val, "CreatedBy", &c.CreatedBy) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - case "mountAction": - err = unpopulate(val, "MountAction", &c.MountAction) - delete(rawMsg, key) - case "mountName": - err = unpopulate(val, "MountName", &c.MountName) - delete(rawMsg, key) - case "mountPath": - err = unpopulate(val, "MountPath", &c.MountPath) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "mountState": - err = unpopulate(val, "MountState", &c.MountState) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "mountedOn": - err = unpopulateTimeRFC3339(val, "MountedOn", &c.MountedOn) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "sourceType": - err = unpopulate(val, "SourceType", &c.SourceType) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -3398,16 +4098,23 @@ func (c *ComputeInstanceDataMount) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceEnvironmentInfo. -func (c ComputeInstanceEnvironmentInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentVersionProperties. +func (c ComponentVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "version", c.Version) + populate(objectMap, "autoDeleteSetting", c.AutoDeleteSetting) + populateAny(objectMap, "componentSpec", c.ComponentSpec) + populate(objectMap, "description", c.Description) + populate(objectMap, "isAnonymous", c.IsAnonymous) + populate(objectMap, "isArchived", c.IsArchived) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "stage", c.Stage) + populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceEnvironmentInfo. -func (c *ComputeInstanceEnvironmentInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentVersionProperties. +func (c *ComponentVersionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3415,11 +4122,32 @@ func (c *ComputeInstanceEnvironmentInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &c.AutoDeleteSetting) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) + case "componentSpec": + err = unpopulate(val, "ComponentSpec", &c.ComponentSpec) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &c.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &c.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &c.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { @@ -3429,18 +4157,16 @@ func (c *ComputeInstanceEnvironmentInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceLastOperation. -func (c ComputeInstanceLastOperation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComponentVersionResourceArmPaginatedResult. +func (c ComponentVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operationName", c.OperationName) - populate(objectMap, "operationStatus", c.OperationStatus) - populateTimeRFC3339(objectMap, "operationTime", c.OperationTime) - populate(objectMap, "operationTrigger", c.OperationTrigger) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceLastOperation. -func (c *ComputeInstanceLastOperation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentVersionResourceArmPaginatedResult. +func (c *ComponentVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3448,17 +4174,11 @@ func (c *ComputeInstanceLastOperation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "operationName": - err = unpopulate(val, "OperationName", &c.OperationName) - delete(rawMsg, key) - case "operationStatus": - err = unpopulate(val, "OperationStatus", &c.OperationStatus) - delete(rawMsg, key) - case "operationTime": - err = unpopulateTimeRFC3339(val, "OperationTime", &c.OperationTime) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "operationTrigger": - err = unpopulate(val, "OperationTrigger", &c.OperationTrigger) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -3468,33 +4188,24 @@ func (c *ComputeInstanceLastOperation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceProperties. -func (c ComputeInstanceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Compute. +func (c Compute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationSharingPolicy", c.ApplicationSharingPolicy) - populate(objectMap, "applications", c.Applications) - populate(objectMap, "computeInstanceAuthorizationType", c.ComputeInstanceAuthorizationType) - populate(objectMap, "connectivityEndpoints", c.ConnectivityEndpoints) - populate(objectMap, "containers", c.Containers) - populate(objectMap, "createdBy", c.CreatedBy) - populate(objectMap, "dataDisks", c.DataDisks) - populate(objectMap, "dataMounts", c.DataMounts) - populate(objectMap, "enableNodePublicIp", c.EnableNodePublicIP) - populate(objectMap, "errors", c.Errors) - populate(objectMap, "lastOperation", c.LastOperation) - populate(objectMap, "personalComputeInstanceSettings", c.PersonalComputeInstanceSettings) - populate(objectMap, "sshSettings", c.SSHSettings) - populate(objectMap, "schedules", c.Schedules) - populate(objectMap, "setupScripts", c.SetupScripts) - populate(objectMap, "state", c.State) - populate(objectMap, "subnet", c.Subnet) - populate(objectMap, "vmSize", c.VMSize) - populate(objectMap, "versions", c.Versions) + populate(objectMap, "computeLocation", c.ComputeLocation) + objectMap["computeType"] = c.ComputeType + populateDateTimeRFC3339(objectMap, "createdOn", c.CreatedOn) + populate(objectMap, "description", c.Description) + populate(objectMap, "disableLocalAuth", c.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", c.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", c.ModifiedOn) + populate(objectMap, "provisioningErrors", c.ProvisioningErrors) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceId", c.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceProperties. -func (c *ComputeInstanceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Compute. +func (c *Compute) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3502,62 +4213,35 @@ func (c *ComputeInstanceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "applicationSharingPolicy": - err = unpopulate(val, "ApplicationSharingPolicy", &c.ApplicationSharingPolicy) - delete(rawMsg, key) - case "applications": - err = unpopulate(val, "Applications", &c.Applications) - delete(rawMsg, key) - case "computeInstanceAuthorizationType": - err = unpopulate(val, "ComputeInstanceAuthorizationType", &c.ComputeInstanceAuthorizationType) - delete(rawMsg, key) - case "connectivityEndpoints": - err = unpopulate(val, "ConnectivityEndpoints", &c.ConnectivityEndpoints) - delete(rawMsg, key) - case "containers": - err = unpopulate(val, "Containers", &c.Containers) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &c.CreatedBy) - delete(rawMsg, key) - case "dataDisks": - err = unpopulate(val, "DataDisks", &c.DataDisks) - delete(rawMsg, key) - case "dataMounts": - err = unpopulate(val, "DataMounts", &c.DataMounts) - delete(rawMsg, key) - case "enableNodePublicIp": - err = unpopulate(val, "EnableNodePublicIP", &c.EnableNodePublicIP) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &c.Errors) + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &c.ComputeLocation) delete(rawMsg, key) - case "lastOperation": - err = unpopulate(val, "LastOperation", &c.LastOperation) + case "computeType": + err = unpopulate(val, "ComputeType", &c.ComputeType) delete(rawMsg, key) - case "personalComputeInstanceSettings": - err = unpopulate(val, "PersonalComputeInstanceSettings", &c.PersonalComputeInstanceSettings) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &c.CreatedOn) delete(rawMsg, key) - case "sshSettings": - err = unpopulate(val, "SSHSettings", &c.SSHSettings) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "schedules": - err = unpopulate(val, "Schedules", &c.Schedules) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) delete(rawMsg, key) - case "setupScripts": - err = unpopulate(val, "SetupScripts", &c.SetupScripts) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &c.IsAttachedCompute) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &c.ModifiedOn) delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &c.Subnet) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &c.ProvisioningErrors) delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &c.VMSize) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) - case "versions": - err = unpopulate(val, "Versions", &c.Versions) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) delete(rawMsg, key) } if err != nil { @@ -3567,18 +4251,25 @@ func (c *ComputeInstanceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceSSHSettings. -func (c ComputeInstanceSSHSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstance. +func (c ComputeInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "adminPublicKey", c.AdminPublicKey) - populate(objectMap, "adminUserName", c.AdminUserName) - populate(objectMap, "sshPort", c.SSHPort) - populate(objectMap, "sshPublicAccess", c.SSHPublicAccess) + populate(objectMap, "computeLocation", c.ComputeLocation) + objectMap["computeType"] = ComputeTypeComputeInstance + populateDateTimeRFC3339(objectMap, "createdOn", c.CreatedOn) + populate(objectMap, "description", c.Description) + populate(objectMap, "disableLocalAuth", c.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", c.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", c.ModifiedOn) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "provisioningErrors", c.ProvisioningErrors) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceId", c.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceSSHSettings. -func (c *ComputeInstanceSSHSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstance. +func (c *ComputeInstance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3586,19 +4277,40 @@ func (c *ComputeInstanceSSHSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "adminPublicKey": - err = unpopulate(val, "AdminPublicKey", &c.AdminPublicKey) + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &c.ComputeLocation) delete(rawMsg, key) - case "adminUserName": - err = unpopulate(val, "AdminUserName", &c.AdminUserName) + case "computeType": + err = unpopulate(val, "ComputeType", &c.ComputeType) delete(rawMsg, key) - case "sshPort": - err = unpopulate(val, "SSHPort", &c.SSHPort) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &c.CreatedOn) delete(rawMsg, key) - case "sshPublicAccess": - err = unpopulate(val, "SSHPublicAccess", &c.SSHPublicAccess) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - } + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &c.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &c.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &c.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } @@ -3606,15 +4318,16 @@ func (c *ComputeInstanceSSHSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceSchema. -func (c ComputeInstanceSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceApplication. +func (c ComputeInstanceApplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "endpointUri", c.EndpointURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceSchema. -func (c *ComputeInstanceSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceApplication. +func (c *ComputeInstanceApplication) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3622,8 +4335,11 @@ func (c *ComputeInstanceSchema) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "endpointUri": + err = unpopulate(val, "EndpointURI", &c.EndpointURI) delete(rawMsg, key) } if err != nil { @@ -3633,15 +4349,15 @@ func (c *ComputeInstanceSchema) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceVersion. -func (c ComputeInstanceVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceAutologgerSettings. +func (c ComputeInstanceAutologgerSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "runtime", c.Runtime) + populate(objectMap, "mlflowAutologger", c.MlflowAutologger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceVersion. -func (c *ComputeInstanceVersion) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceAutologgerSettings. +func (c *ComputeInstanceAutologgerSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3649,8 +4365,8 @@ func (c *ComputeInstanceVersion) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "runtime": - err = unpopulate(val, "Runtime", &c.Runtime) + case "mlflowAutologger": + err = unpopulate(val, "MlflowAutologger", &c.MlflowAutologger) delete(rawMsg, key) } if err != nil { @@ -3660,23 +4376,16 @@ func (c *ComputeInstanceVersion) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeResource. -func (c ComputeResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceConnectivityEndpoints. +func (c ComputeInstanceConnectivityEndpoints) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "privateIpAddress", c.PrivateIPAddress) + populate(objectMap, "publicIpAddress", c.PublicIPAddress) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResource. -func (c *ComputeResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceConnectivityEndpoints. +func (c *ComputeInstanceConnectivityEndpoints) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3684,32 +4393,11 @@ func (c *ComputeResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalComputeClassification(val) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "privateIpAddress": + err = unpopulate(val, "PrivateIPAddress", &c.PrivateIPAddress) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "publicIpAddress": + err = unpopulate(val, "PublicIPAddress", &c.PublicIPAddress) delete(rawMsg, key) } if err != nil { @@ -3719,15 +4407,20 @@ func (c *ComputeResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeResourceSchema. -func (c ComputeResourceSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceContainer. +func (c ComputeInstanceContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "autosave", c.Autosave) + populate(objectMap, "environment", c.Environment) + populate(objectMap, "gpu", c.Gpu) + populate(objectMap, "name", c.Name) + populate(objectMap, "network", c.Network) + populate(objectMap, "services", c.Services) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResourceSchema. -func (c *ComputeResourceSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceContainer. +func (c *ComputeInstanceContainer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3735,8 +4428,23 @@ func (c *ComputeResourceSchema) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - c.Properties, err = unmarshalComputeClassification(val) + case "autosave": + err = unpopulate(val, "Autosave", &c.Autosave) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &c.Environment) + delete(rawMsg, key) + case "gpu": + err = unpopulate(val, "Gpu", &c.Gpu) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "network": + err = unpopulate(val, "Network", &c.Network) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &c.Services) delete(rawMsg, key) } if err != nil { @@ -3746,15 +4454,17 @@ func (c *ComputeResourceSchema) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeSchedules. -func (c ComputeSchedules) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceCreatedBy. +func (c ComputeInstanceCreatedBy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeStartStop", c.ComputeStartStop) + populate(objectMap, "userId", c.UserID) + populate(objectMap, "userName", c.UserName) + populate(objectMap, "userOrgId", c.UserOrgID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeSchedules. -func (c *ComputeSchedules) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceCreatedBy. +func (c *ComputeInstanceCreatedBy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3762,8 +4472,14 @@ func (c *ComputeSchedules) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "computeStartStop": - err = unpopulate(val, "ComputeStartStop", &c.ComputeStartStop) + case "userId": + err = unpopulate(val, "UserID", &c.UserID) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &c.UserName) + delete(rawMsg, key) + case "userOrgId": + err = unpopulate(val, "UserOrgID", &c.UserOrgID) delete(rawMsg, key) } if err != nil { @@ -3773,15 +4489,18 @@ func (c *ComputeSchedules) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeSecrets. -func (c ComputeSecrets) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceDataDisk. +func (c ComputeInstanceDataDisk) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["computeType"] = c.ComputeType + populate(objectMap, "caching", c.Caching) + populate(objectMap, "diskSizeGB", c.DiskSizeGB) + populate(objectMap, "lun", c.Lun) + populate(objectMap, "storageAccountType", c.StorageAccountType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeSecrets. -func (c *ComputeSecrets) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceDataDisk. +func (c *ComputeInstanceDataDisk) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3789,8 +4508,17 @@ func (c *ComputeSecrets) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "computeType": - err = unpopulate(val, "ComputeType", &c.ComputeType) + case "caching": + err = unpopulate(val, "Caching", &c.Caching) + delete(rawMsg, key) + case "diskSizeGB": + err = unpopulate(val, "DiskSizeGB", &c.DiskSizeGB) + delete(rawMsg, key) + case "lun": + err = unpopulate(val, "Lun", &c.Lun) + delete(rawMsg, key) + case "storageAccountType": + err = unpopulate(val, "StorageAccountType", &c.StorageAccountType) delete(rawMsg, key) } if err != nil { @@ -3800,22 +4528,23 @@ func (c *ComputeSecrets) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ComputeStartStopSchedule. -func (c ComputeStartStopSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceDataMount. +func (c ComputeInstanceDataMount) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", c.Action) - populate(objectMap, "cron", c.Cron) - populate(objectMap, "id", c.ID) - populate(objectMap, "provisioningStatus", c.ProvisioningStatus) - populate(objectMap, "recurrence", c.Recurrence) - populate(objectMap, "schedule", c.Schedule) - populate(objectMap, "status", c.Status) - populate(objectMap, "triggerType", c.TriggerType) + populate(objectMap, "createdBy", c.CreatedBy) + populate(objectMap, "error", c.Error) + populate(objectMap, "mountAction", c.MountAction) + populate(objectMap, "mountName", c.MountName) + populate(objectMap, "mountPath", c.MountPath) + populate(objectMap, "mountState", c.MountState) + populateDateTimeRFC3339(objectMap, "mountedOn", c.MountedOn) + populate(objectMap, "source", c.Source) + populate(objectMap, "sourceType", c.SourceType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeStartStopSchedule. -func (c *ComputeStartStopSchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceDataMount. +func (c *ComputeInstanceDataMount) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3823,29 +4552,32 @@ func (c *ComputeStartStopSchedule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &c.Action) + case "createdBy": + err = unpopulate(val, "CreatedBy", &c.CreatedBy) delete(rawMsg, key) - case "cron": - err = unpopulate(val, "Cron", &c.Cron) + case "error": + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) + case "mountAction": + err = unpopulate(val, "MountAction", &c.MountAction) delete(rawMsg, key) - case "provisioningStatus": - err = unpopulate(val, "ProvisioningStatus", &c.ProvisioningStatus) + case "mountName": + err = unpopulate(val, "MountName", &c.MountName) delete(rawMsg, key) - case "recurrence": - err = unpopulate(val, "Recurrence", &c.Recurrence) + case "mountPath": + err = unpopulate(val, "MountPath", &c.MountPath) delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &c.Schedule) + case "mountState": + err = unpopulate(val, "MountState", &c.MountState) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "mountedOn": + err = unpopulateDateTimeRFC3339(val, "MountedOn", &c.MountedOn) delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &c.TriggerType) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &c.SourceType) delete(rawMsg, key) } if err != nil { @@ -3855,16 +4587,16 @@ func (c *ComputeStartStopSchedule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerResourceRequirements. -func (c ContainerResourceRequirements) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceEnvironmentInfo. +func (c ComputeInstanceEnvironmentInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containerResourceLimits", c.ContainerResourceLimits) - populate(objectMap, "containerResourceRequests", c.ContainerResourceRequests) + populate(objectMap, "name", c.Name) + populate(objectMap, "version", c.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceRequirements. -func (c *ContainerResourceRequirements) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceEnvironmentInfo. +func (c *ComputeInstanceEnvironmentInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3872,11 +4604,11 @@ func (c *ContainerResourceRequirements) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "containerResourceLimits": - err = unpopulate(val, "ContainerResourceLimits", &c.ContainerResourceLimits) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "containerResourceRequests": - err = unpopulate(val, "ContainerResourceRequests", &c.ContainerResourceRequests) + case "version": + err = unpopulate(val, "Version", &c.Version) delete(rawMsg, key) } if err != nil { @@ -3886,17 +4618,18 @@ func (c *ContainerResourceRequirements) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerResourceSettings. -func (c ContainerResourceSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceLastOperation. +func (c ComputeInstanceLastOperation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", c.CPU) - populate(objectMap, "gpu", c.Gpu) - populate(objectMap, "memory", c.Memory) + populate(objectMap, "operationName", c.OperationName) + populate(objectMap, "operationStatus", c.OperationStatus) + populateDateTimeRFC3339(objectMap, "operationTime", c.OperationTime) + populate(objectMap, "operationTrigger", c.OperationTrigger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceSettings. -func (c *ContainerResourceSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceLastOperation. +func (c *ComputeInstanceLastOperation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3904,14 +4637,17 @@ func (c *ContainerResourceSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "cpu": - err = unpopulate(val, "CPU", &c.CPU) + case "operationName": + err = unpopulate(val, "OperationName", &c.OperationName) delete(rawMsg, key) - case "gpu": - err = unpopulate(val, "Gpu", &c.Gpu) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &c.OperationStatus) delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &c.Memory) + case "operationTime": + err = unpopulateDateTimeRFC3339(val, "OperationTime", &c.OperationTime) + delete(rawMsg, key) + case "operationTrigger": + err = unpopulate(val, "OperationTrigger", &c.OperationTrigger) delete(rawMsg, key) } if err != nil { @@ -3921,15 +4657,41 @@ func (c *ContainerResourceSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CosmosDbSettings. -func (c CosmosDbSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceProperties. +func (c ComputeInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "collectionsThroughput", c.CollectionsThroughput) + populate(objectMap, "applicationSharingPolicy", c.ApplicationSharingPolicy) + populate(objectMap, "applications", c.Applications) + populate(objectMap, "autologgerSettings", c.AutologgerSettings) + populate(objectMap, "computeInstanceAuthorizationType", c.ComputeInstanceAuthorizationType) + populate(objectMap, "connectivityEndpoints", c.ConnectivityEndpoints) + populate(objectMap, "containers", c.Containers) + populate(objectMap, "createdBy", c.CreatedBy) + populate(objectMap, "customServices", c.CustomServices) + populate(objectMap, "dataDisks", c.DataDisks) + populate(objectMap, "dataMounts", c.DataMounts) + populate(objectMap, "enableNodePublicIp", c.EnableNodePublicIP) + populate(objectMap, "enableOSPatching", c.EnableOSPatching) + populate(objectMap, "enableRootAccess", c.EnableRootAccess) + populate(objectMap, "enableSSO", c.EnableSSO) + populate(objectMap, "errors", c.Errors) + populate(objectMap, "idleTimeBeforeShutdown", c.IdleTimeBeforeShutdown) + populate(objectMap, "lastOperation", c.LastOperation) + populate(objectMap, "osImageMetadata", c.OSImageMetadata) + populate(objectMap, "personalComputeInstanceSettings", c.PersonalComputeInstanceSettings) + populate(objectMap, "releaseQuotaOnStop", c.ReleaseQuotaOnStop) + populate(objectMap, "sshSettings", c.SSHSettings) + populate(objectMap, "schedules", c.Schedules) + populate(objectMap, "setupScripts", c.SetupScripts) + populate(objectMap, "state", c.State) + populate(objectMap, "subnet", c.Subnet) + populate(objectMap, "vmSize", c.VMSize) + populate(objectMap, "versions", c.Versions) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbSettings. -func (c *CosmosDbSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceProperties. +func (c *ComputeInstanceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3937,8 +4699,86 @@ func (c *CosmosDbSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "collectionsThroughput": - err = unpopulate(val, "CollectionsThroughput", &c.CollectionsThroughput) + case "applicationSharingPolicy": + err = unpopulate(val, "ApplicationSharingPolicy", &c.ApplicationSharingPolicy) + delete(rawMsg, key) + case "applications": + err = unpopulate(val, "Applications", &c.Applications) + delete(rawMsg, key) + case "autologgerSettings": + err = unpopulate(val, "AutologgerSettings", &c.AutologgerSettings) + delete(rawMsg, key) + case "computeInstanceAuthorizationType": + err = unpopulate(val, "ComputeInstanceAuthorizationType", &c.ComputeInstanceAuthorizationType) + delete(rawMsg, key) + case "connectivityEndpoints": + err = unpopulate(val, "ConnectivityEndpoints", &c.ConnectivityEndpoints) + delete(rawMsg, key) + case "containers": + err = unpopulate(val, "Containers", &c.Containers) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &c.CreatedBy) + delete(rawMsg, key) + case "customServices": + err = unpopulate(val, "CustomServices", &c.CustomServices) + delete(rawMsg, key) + case "dataDisks": + err = unpopulate(val, "DataDisks", &c.DataDisks) + delete(rawMsg, key) + case "dataMounts": + err = unpopulate(val, "DataMounts", &c.DataMounts) + delete(rawMsg, key) + case "enableNodePublicIp": + err = unpopulate(val, "EnableNodePublicIP", &c.EnableNodePublicIP) + delete(rawMsg, key) + case "enableOSPatching": + err = unpopulate(val, "EnableOSPatching", &c.EnableOSPatching) + delete(rawMsg, key) + case "enableRootAccess": + err = unpopulate(val, "EnableRootAccess", &c.EnableRootAccess) + delete(rawMsg, key) + case "enableSSO": + err = unpopulate(val, "EnableSSO", &c.EnableSSO) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "idleTimeBeforeShutdown": + err = unpopulate(val, "IdleTimeBeforeShutdown", &c.IdleTimeBeforeShutdown) + delete(rawMsg, key) + case "lastOperation": + err = unpopulate(val, "LastOperation", &c.LastOperation) + delete(rawMsg, key) + case "osImageMetadata": + err = unpopulate(val, "OSImageMetadata", &c.OSImageMetadata) + delete(rawMsg, key) + case "personalComputeInstanceSettings": + err = unpopulate(val, "PersonalComputeInstanceSettings", &c.PersonalComputeInstanceSettings) + delete(rawMsg, key) + case "releaseQuotaOnStop": + err = unpopulate(val, "ReleaseQuotaOnStop", &c.ReleaseQuotaOnStop) + delete(rawMsg, key) + case "sshSettings": + err = unpopulate(val, "SSHSettings", &c.SSHSettings) + delete(rawMsg, key) + case "schedules": + err = unpopulate(val, "Schedules", &c.Schedules) + delete(rawMsg, key) + case "setupScripts": + err = unpopulate(val, "SetupScripts", &c.SetupScripts) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &c.Subnet) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &c.VMSize) + delete(rawMsg, key) + case "versions": + err = unpopulate(val, "Versions", &c.Versions) delete(rawMsg, key) } if err != nil { @@ -3948,19 +4788,18 @@ func (c *CosmosDbSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CronTrigger. -func (c CronTrigger) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceSSHSettings. +func (c ComputeInstanceSSHSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endTime", c.EndTime) - populate(objectMap, "expression", c.Expression) - populate(objectMap, "startTime", c.StartTime) - populate(objectMap, "timeZone", c.TimeZone) - objectMap["triggerType"] = TriggerTypeCron + populate(objectMap, "adminPublicKey", c.AdminPublicKey) + populate(objectMap, "adminUserName", c.AdminUserName) + populate(objectMap, "sshPort", c.SSHPort) + populate(objectMap, "sshPublicAccess", c.SSHPublicAccess) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CronTrigger. -func (c *CronTrigger) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceSSHSettings. +func (c *ComputeInstanceSSHSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3968,20 +4807,17 @@ func (c *CronTrigger) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulate(val, "EndTime", &c.EndTime) - delete(rawMsg, key) - case "expression": - err = unpopulate(val, "Expression", &c.Expression) + case "adminPublicKey": + err = unpopulate(val, "AdminPublicKey", &c.AdminPublicKey) delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &c.StartTime) + case "adminUserName": + err = unpopulate(val, "AdminUserName", &c.AdminUserName) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &c.TimeZone) + case "sshPort": + err = unpopulate(val, "SSHPort", &c.SSHPort) delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &c.TriggerType) + case "sshPublicAccess": + err = unpopulate(val, "SSHPublicAccess", &c.SSHPublicAccess) delete(rawMsg, key) } if err != nil { @@ -3991,16 +4827,15 @@ func (c *CronTrigger) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomForecastHorizon. -func (c CustomForecastHorizon) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceSchema. +func (c ComputeInstanceSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = ForecastHorizonModeCustom - populate(objectMap, "value", c.Value) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomForecastHorizon. -func (c *CustomForecastHorizon) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceSchema. +func (c *ComputeInstanceSchema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4008,11 +4843,8 @@ func (c *CustomForecastHorizon) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &c.Mode) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { @@ -4022,18 +4854,15 @@ func (c *CustomForecastHorizon) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomModelJobInput. -func (c CustomModelJobInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeInstanceVersion. +func (c ComputeInstanceVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - objectMap["jobInputType"] = JobInputTypeCustomModel - populate(objectMap, "mode", c.Mode) - populate(objectMap, "uri", c.URI) + populate(objectMap, "runtime", c.Runtime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomModelJobInput. -func (c *CustomModelJobInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeInstanceVersion. +func (c *ComputeInstanceVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4041,17 +4870,8 @@ func (c *CustomModelJobInput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "jobInputType": - err = unpopulate(val, "JobInputType", &c.JobInputType) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &c.Mode) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &c.URI) + case "runtime": + err = unpopulate(val, "Runtime", &c.Runtime) delete(rawMsg, key) } if err != nil { @@ -4061,18 +4881,18 @@ func (c *CustomModelJobInput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomModelJobOutput. -func (c CustomModelJobOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeRecurrenceSchedule. +func (c ComputeRecurrenceSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - objectMap["jobOutputType"] = JobOutputTypeCustomModel - populate(objectMap, "mode", c.Mode) - populate(objectMap, "uri", c.URI) + populate(objectMap, "hours", c.Hours) + populate(objectMap, "minutes", c.Minutes) + populate(objectMap, "monthDays", c.MonthDays) + populate(objectMap, "weekDays", c.WeekDays) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomModelJobOutput. -func (c *CustomModelJobOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeRecurrenceSchedule. +func (c *ComputeRecurrenceSchedule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4080,17 +4900,17 @@ func (c *CustomModelJobOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) + case "hours": + err = unpopulate(val, "Hours", &c.Hours) delete(rawMsg, key) - case "jobOutputType": - err = unpopulate(val, "JobOutputType", &c.JobOutputType) + case "minutes": + err = unpopulate(val, "Minutes", &c.Minutes) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &c.Mode) + case "monthDays": + err = unpopulate(val, "MonthDays", &c.MonthDays) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &c.URI) + case "weekDays": + err = unpopulate(val, "WeekDays", &c.WeekDays) delete(rawMsg, key) } if err != nil { @@ -4100,16 +4920,23 @@ func (c *CustomModelJobOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomNCrossValidations. -func (c CustomNCrossValidations) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeResource. +func (c ComputeResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = NCrossValidationsModeCustom - populate(objectMap, "value", c.Value) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomNCrossValidations. -func (c *CustomNCrossValidations) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResource. +func (c *ComputeResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4117,30 +4944,50 @@ func (c *CustomNCrossValidations) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &c.Mode) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomSeasonality. -func (c CustomSeasonality) MarshalJSON() ([]byte, error) { + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + c.Properties, err = unmarshalComputeClassification(val) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComputeResourceSchema. +func (c ComputeResourceSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = SeasonalityModeCustom - populate(objectMap, "value", c.Value) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomSeasonality. -func (c *CustomSeasonality) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResourceSchema. +func (c *ComputeResourceSchema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4148,11 +4995,8 @@ func (c *CustomSeasonality) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &c.Mode) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "properties": + c.Properties, err = unmarshalComputeClassification(val) delete(rawMsg, key) } if err != nil { @@ -4162,16 +5006,15 @@ func (c *CustomSeasonality) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomTargetLags. -func (c CustomTargetLags) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeRuntimeDto. +func (c ComputeRuntimeDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = TargetLagsModeCustom - populate(objectMap, "values", c.Values) + populate(objectMap, "sparkRuntimeVersion", c.SparkRuntimeVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomTargetLags. -func (c *CustomTargetLags) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeRuntimeDto. +func (c *ComputeRuntimeDto) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4179,11 +5022,8 @@ func (c *CustomTargetLags) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &c.Mode) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &c.Values) + case "sparkRuntimeVersion": + err = unpopulate(val, "SparkRuntimeVersion", &c.SparkRuntimeVersion) delete(rawMsg, key) } if err != nil { @@ -4193,16 +5033,15 @@ func (c *CustomTargetLags) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomTargetRollingWindowSize. -func (c CustomTargetRollingWindowSize) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeSchedules. +func (c ComputeSchedules) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = TargetRollingWindowSizeModeCustom - populate(objectMap, "value", c.Value) + populate(objectMap, "computeStartStop", c.ComputeStartStop) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomTargetRollingWindowSize. -func (c *CustomTargetRollingWindowSize) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeSchedules. +func (c *ComputeSchedules) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -4210,11 +5049,8 @@ func (c *CustomTargetRollingWindowSize) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &c.Mode) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "computeStartStop": + err = unpopulate(val, "ComputeStartStop", &c.ComputeStartStop) delete(rawMsg, key) } if err != nil { @@ -4224,842 +5060,811 @@ func (c *CustomTargetRollingWindowSize) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DataContainer. -func (d DataContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeSecrets. +func (c ComputeSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + objectMap["computeType"] = c.ComputeType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataContainer. -func (d *DataContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeSecrets. +func (c *ComputeSecrets) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "computeType": + err = unpopulate(val, "ComputeType", &c.ComputeType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataContainerProperties. -func (d DataContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComputeStartStopSchedule. +func (c ComputeStartStopSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataType", d.DataType) - populate(objectMap, "description", d.Description) - populate(objectMap, "isArchived", d.IsArchived) - populate(objectMap, "latestVersion", d.LatestVersion) - populate(objectMap, "nextVersion", d.NextVersion) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "action", c.Action) + populate(objectMap, "cron", c.Cron) + populate(objectMap, "id", c.ID) + populate(objectMap, "provisioningStatus", c.ProvisioningStatus) + populate(objectMap, "recurrence", c.Recurrence) + populate(objectMap, "schedule", c.Schedule) + populate(objectMap, "status", c.Status) + populate(objectMap, "triggerType", c.TriggerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataContainerProperties. -func (d *DataContainerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeStartStopSchedule. +func (c *ComputeStartStopSchedule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "dataType": - err = unpopulate(val, "DataType", &d.DataType) + case "action": + err = unpopulate(val, "Action", &c.Action) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) + case "cron": + err = unpopulate(val, "Cron", &c.Cron) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &d.IsArchived) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "latestVersion": - err = unpopulate(val, "LatestVersion", &d.LatestVersion) + case "provisioningStatus": + err = unpopulate(val, "ProvisioningStatus", &c.ProvisioningStatus) delete(rawMsg, key) - case "nextVersion": - err = unpopulate(val, "NextVersion", &d.NextVersion) + case "recurrence": + err = unpopulate(val, "Recurrence", &c.Recurrence) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "schedule": + err = unpopulate(val, "Schedule", &c.Schedule) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &c.TriggerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataContainerResourceArmPaginatedResult. -func (d DataContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerResourceRequirements. +func (c ContainerResourceRequirements) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "containerResourceLimits", c.ContainerResourceLimits) + populate(objectMap, "containerResourceRequests", c.ContainerResourceRequests) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataContainerResourceArmPaginatedResult. -func (d *DataContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceRequirements. +func (c *ContainerResourceRequirements) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "containerResourceLimits": + err = unpopulate(val, "ContainerResourceLimits", &c.ContainerResourceLimits) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "containerResourceRequests": + err = unpopulate(val, "ContainerResourceRequests", &c.ContainerResourceRequests) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataFactory. -func (d DataFactory) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerResourceSettings. +func (c ContainerResourceSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", d.ComputeLocation) - objectMap["computeType"] = ComputeTypeDataFactory - populateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) - populate(objectMap, "description", d.Description) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) - populate(objectMap, "provisioningErrors", d.ProvisioningErrors) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "resourceId", d.ResourceID) + populate(objectMap, "cpu", c.CPU) + populate(objectMap, "gpu", c.Gpu) + populate(objectMap, "memory", c.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataFactory. -func (d *DataFactory) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceSettings. +func (c *ContainerResourceSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &d.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) - delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) - delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) + case "cpu": + err = unpopulate(val, "CPU", &c.CPU) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + case "gpu": + err = unpopulate(val, "Gpu", &c.Gpu) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &d.ResourceID) + case "memory": + err = unpopulate(val, "Memory", &c.Memory) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalytics. -func (d DataLakeAnalytics) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CosmosDbSettings. +func (c CosmosDbSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", d.ComputeLocation) - objectMap["computeType"] = ComputeTypeDataLakeAnalytics - populateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) - populate(objectMap, "description", d.Description) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "provisioningErrors", d.ProvisioningErrors) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "resourceId", d.ResourceID) + populate(objectMap, "collectionsThroughput", c.CollectionsThroughput) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalytics. -func (d *DataLakeAnalytics) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbSettings. +func (c *CosmosDbSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &d.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) - delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) - delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &d.ResourceID) + case "collectionsThroughput": + err = unpopulate(val, "CollectionsThroughput", &c.CollectionsThroughput) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalyticsSchema. -func (d DataLakeAnalyticsSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CreateMonitorAction. +func (c CreateMonitorAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) + objectMap["actionType"] = ScheduleActionTypeCreateMonitor + populate(objectMap, "monitorDefinition", c.MonitorDefinition) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalyticsSchema. -func (d *DataLakeAnalyticsSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateMonitorAction. +func (c *CreateMonitorAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "actionType": + err = unpopulate(val, "ActionType", &c.ActionType) + delete(rawMsg, key) + case "monitorDefinition": + err = unpopulate(val, "MonitorDefinition", &c.MonitorDefinition) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalyticsSchemaProperties. -func (d DataLakeAnalyticsSchemaProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Cron. +func (c Cron) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataLakeStoreAccountName", d.DataLakeStoreAccountName) + populate(objectMap, "expression", c.Expression) + populate(objectMap, "startTime", c.StartTime) + populate(objectMap, "timeZone", c.TimeZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalyticsSchemaProperties. -func (d *DataLakeAnalyticsSchemaProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Cron. +func (c *Cron) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "dataLakeStoreAccountName": - err = unpopulate(val, "DataLakeStoreAccountName", &d.DataLakeStoreAccountName) + case "expression": + err = unpopulate(val, "Expression", &c.Expression) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &c.StartTime) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &c.TimeZone) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataPathAssetReference. -func (d DataPathAssetReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CronTrigger. +func (c CronTrigger) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "datastoreId", d.DatastoreID) - populate(objectMap, "path", d.Path) - objectMap["referenceType"] = ReferenceTypeDataPath + populate(objectMap, "endTime", c.EndTime) + populate(objectMap, "expression", c.Expression) + populate(objectMap, "startTime", c.StartTime) + populate(objectMap, "timeZone", c.TimeZone) + objectMap["triggerType"] = TriggerTypeCron return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataPathAssetReference. -func (d *DataPathAssetReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CronTrigger. +func (c *CronTrigger) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "datastoreId": - err = unpopulate(val, "DatastoreID", &d.DatastoreID) + case "endTime": + err = unpopulate(val, "EndTime", &c.EndTime) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &d.Path) + case "expression": + err = unpopulate(val, "Expression", &c.Expression) delete(rawMsg, key) - case "referenceType": - err = unpopulate(val, "ReferenceType", &d.ReferenceType) + case "startTime": + err = unpopulate(val, "StartTime", &c.StartTime) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &c.TimeZone) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &c.TriggerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataVersionBase. -func (d DataVersionBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomForecastHorizon. +func (c CustomForecastHorizon) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + objectMap["mode"] = ForecastHorizonModeCustom + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBase. -func (d *DataVersionBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomForecastHorizon. +func (c *CustomForecastHorizon) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - d.Properties, err = unmarshalDataVersionBasePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataVersionBaseProperties. -func (d DataVersionBaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomInferencingServer. +func (c CustomInferencingServer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["dataType"] = d.DataType - populate(objectMap, "dataUri", d.DataURI) - populate(objectMap, "description", d.Description) - populate(objectMap, "isAnonymous", d.IsAnonymous) - populate(objectMap, "isArchived", d.IsArchived) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "inferenceConfiguration", c.InferenceConfiguration) + objectMap["serverType"] = InferencingServerTypeCustom return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBaseProperties. -func (d *DataVersionBaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomInferencingServer. +func (c *CustomInferencingServer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "dataType": - err = unpopulate(val, "DataType", &d.DataType) - delete(rawMsg, key) - case "dataUri": - err = unpopulate(val, "DataURI", &d.DataURI) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "isAnonymous": - err = unpopulate(val, "IsAnonymous", &d.IsAnonymous) + case "inferenceConfiguration": + err = unpopulate(val, "InferenceConfiguration", &c.InferenceConfiguration) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &d.IsArchived) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "serverType": + err = unpopulate(val, "ServerType", &c.ServerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataVersionBaseResourceArmPaginatedResult. -func (d DataVersionBaseResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomKeys. +func (c CustomKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "keys", c.Keys) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBaseResourceArmPaginatedResult. -func (d *DataVersionBaseResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomKeys. +func (c *CustomKeys) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "keys": + err = unpopulate(val, "Keys", &c.Keys) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Databricks. -func (d Databricks) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomKeysWorkspaceConnectionProperties. +func (c CustomKeysWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", d.ComputeLocation) - objectMap["computeType"] = ComputeTypeDatabricks - populateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) - populate(objectMap, "description", d.Description) - populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "provisioningErrors", d.ProvisioningErrors) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "resourceId", d.ResourceID) + objectMap["authType"] = ConnectionAuthTypeCustomKeys + populate(objectMap, "category", c.Category) + populate(objectMap, "createdByWorkspaceArmId", c.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", c.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", c.ExpiryTime) + populate(objectMap, "isSharedToAll", c.IsSharedToAll) + populateAny(objectMap, "metadata", c.Metadata) + populate(objectMap, "target", c.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Databricks. -func (d *Databricks) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomKeysWorkspaceConnectionProperties. +func (c *CustomKeysWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &d.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) + case "authType": + err = unpopulate(val, "AuthType", &c.AuthType) delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + case "category": + err = unpopulate(val, "Category", &c.Category) delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &c.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) + case "credentials": + err = unpopulate(val, "Credentials", &c.Credentials) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &c.ExpiryTime) delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &c.IsSharedToAll) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + case "metadata": + err = unpopulate(val, "Metadata", &c.Metadata) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &d.ResourceID) + case "target": + err = unpopulate(val, "Target", &c.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabricksComputeSecrets. -func (d DatabricksComputeSecrets) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomMetricThreshold. +func (c CustomMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["computeType"] = ComputeTypeDatabricks - populate(objectMap, "databricksAccessToken", d.DatabricksAccessToken) + populate(objectMap, "metric", c.Metric) + populate(objectMap, "threshold", c.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksComputeSecrets. -func (d *DatabricksComputeSecrets) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomMetricThreshold. +func (c *CustomMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "computeType": - err = unpopulate(val, "ComputeType", &d.ComputeType) + case "metric": + err = unpopulate(val, "Metric", &c.Metric) delete(rawMsg, key) - case "databricksAccessToken": - err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) + case "threshold": + err = unpopulate(val, "Threshold", &c.Threshold) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabricksComputeSecretsProperties. -func (d DatabricksComputeSecretsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomModelJobInput. +func (c CustomModelJobInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databricksAccessToken", d.DatabricksAccessToken) + populate(objectMap, "description", c.Description) + objectMap["jobInputType"] = JobInputTypeCustomModel + populate(objectMap, "mode", c.Mode) + populate(objectMap, "uri", c.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksComputeSecretsProperties. -func (d *DatabricksComputeSecretsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomModelJobInput. +func (c *CustomModelJobInput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "databricksAccessToken": - err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &c.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabricksProperties. -func (d DatabricksProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomModelJobOutput. +func (c CustomModelJobOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "databricksAccessToken", d.DatabricksAccessToken) - populate(objectMap, "workspaceUrl", d.WorkspaceURL) + populate(objectMap, "assetName", c.AssetName) + populate(objectMap, "assetVersion", c.AssetVersion) + populate(objectMap, "autoDeleteSetting", c.AutoDeleteSetting) + populate(objectMap, "description", c.Description) + objectMap["jobOutputType"] = JobOutputTypeCustomModel + populate(objectMap, "mode", c.Mode) + populate(objectMap, "uri", c.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksProperties. -func (d *DatabricksProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomModelJobOutput. +func (c *CustomModelJobOutput) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "databricksAccessToken": - err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) + case "assetName": + err = unpopulate(val, "AssetName", &c.AssetName) delete(rawMsg, key) - case "workspaceUrl": - err = unpopulate(val, "WorkspaceURL", &d.WorkspaceURL) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &c.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &c.AutoDeleteSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &c.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabricksSchema. -func (d DatabricksSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomMonitoringSignal. +func (c CustomMonitoringSignal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) + populate(objectMap, "componentId", c.ComponentID) + populate(objectMap, "inputAssets", c.InputAssets) + populate(objectMap, "inputs", c.Inputs) + populate(objectMap, "metricThresholds", c.MetricThresholds) + populate(objectMap, "notificationTypes", c.NotificationTypes) + populate(objectMap, "properties", c.Properties) + objectMap["signalType"] = MonitoringSignalTypeCustom + populate(objectMap, "workspaceConnection", c.WorkspaceConnection) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksSchema. -func (d *DatabricksSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomMonitoringSignal. +func (c *CustomMonitoringSignal) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { + case "componentId": + err = unpopulate(val, "ComponentID", &c.ComponentID) + delete(rawMsg, key) + case "inputAssets": + c.InputAssets, err = unmarshalMonitoringInputDataBaseClassificationMap(val) + delete(rawMsg, key) + case "inputs": + c.Inputs, err = unmarshalJobInputClassificationMap(val) + delete(rawMsg, key) + case "metricThresholds": + err = unpopulate(val, "MetricThresholds", &c.MetricThresholds) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &c.NotificationTypes) + delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &c.SignalType) + delete(rawMsg, key) + case "workspaceConnection": + err = unpopulate(val, "WorkspaceConnection", &c.WorkspaceConnection) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Datastore. -func (d Datastore) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomNCrossValidations. +func (c CustomNCrossValidations) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + objectMap["mode"] = NCrossValidationsModeCustom + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Datastore. -func (d *Datastore) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomNCrossValidations. +func (c *CustomNCrossValidations) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - d.Properties, err = unmarshalDatastorePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatastoreCredentials. -func (d DatastoreCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomSeasonality. +func (c CustomSeasonality) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["credentialsType"] = d.CredentialsType + objectMap["mode"] = SeasonalityModeCustom + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreCredentials. -func (d *DatastoreCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomSeasonality. +func (c *CustomSeasonality) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "credentialsType": - err = unpopulate(val, "CredentialsType", &d.CredentialsType) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatastoreProperties. -func (d DatastoreProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomService. +func (c CustomService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentials", d.Credentials) - objectMap["datastoreType"] = d.DatastoreType - populate(objectMap, "description", d.Description) - populate(objectMap, "isDefault", d.IsDefault) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) + populate(objectMap, "docker", c.Docker) + populate(objectMap, "endpoints", c.Endpoints) + populate(objectMap, "environmentVariables", c.EnvironmentVariables) + populate(objectMap, "image", c.Image) + populate(objectMap, "kernel", c.Kernel) + populate(objectMap, "name", c.Name) + populate(objectMap, "volumes", c.Volumes) + if c.AdditionalProperties != nil { + for key, val := range c.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreProperties. -func (d *DatastoreProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomService. +func (c *CustomService) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "credentials": - d.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + case "docker": + err = unpopulate(val, "Docker", &c.Docker) delete(rawMsg, key) - case "datastoreType": - err = unpopulate(val, "DatastoreType", &d.DatastoreType) + case "endpoints": + err = unpopulate(val, "Endpoints", &c.Endpoints) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &d.IsDefault) + case "image": + err = unpopulate(val, "Image", &c.Image) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "kernel": + err = unpopulate(val, "Kernel", &c.Kernel) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "volumes": + err = unpopulate(val, "Volumes", &c.Volumes) + delete(rawMsg, key) + default: + if c.AdditionalProperties == nil { + c.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + c.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatastoreResourceArmPaginatedResult. -func (d DatastoreResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomTargetLags. +func (c CustomTargetLags) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + objectMap["mode"] = TargetLagsModeCustom + populate(objectMap, "values", c.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreResourceArmPaginatedResult. -func (d *DatastoreResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomTargetLags. +func (c *CustomTargetLags) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "values": + err = unpopulate(val, "Values", &c.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DatastoreSecrets. -func (d DatastoreSecrets) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomTargetRollingWindowSize. +func (c CustomTargetRollingWindowSize) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["secretsType"] = d.SecretsType + objectMap["mode"] = TargetRollingWindowSizeModeCustom + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreSecrets. -func (d *DatastoreSecrets) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomTargetRollingWindowSize. +func (c *CustomTargetRollingWindowSize) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "secretsType": - err = unpopulate(val, "SecretsType", &d.SecretsType) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefaultScaleSettings. -func (d DefaultScaleSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataCollector. +func (d DataCollector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["scaleType"] = ScaleTypeDefault + populate(objectMap, "collections", d.Collections) + populate(objectMap, "requestLogging", d.RequestLogging) + populate(objectMap, "rollingRate", d.RollingRate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultScaleSettings. -func (d *DefaultScaleSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataCollector. +func (d *DataCollector) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5067,8 +5872,14 @@ func (d *DefaultScaleSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "scaleType": - err = unpopulate(val, "ScaleType", &d.ScaleType) + case "collections": + err = unpopulate(val, "Collections", &d.Collections) + delete(rawMsg, key) + case "requestLogging": + err = unpopulate(val, "RequestLogging", &d.RequestLogging) + delete(rawMsg, key) + case "rollingRate": + err = unpopulate(val, "RollingRate", &d.RollingRate) delete(rawMsg, key) } if err != nil { @@ -5078,15 +5889,19 @@ func (d *DefaultScaleSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentLogs. -func (d DeploymentLogs) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataContainer. +func (d DataContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "content", d.Content) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentLogs. -func (d *DeploymentLogs) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataContainer. +func (d *DataContainer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5094,8 +5909,20 @@ func (d *DeploymentLogs) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "content": - err = unpopulate(val, "Content", &d.Content) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { @@ -5105,16 +5932,21 @@ func (d *DeploymentLogs) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentLogsRequest. -func (d DeploymentLogsRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataContainerProperties. +func (d DataContainerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containerType", d.ContainerType) - populate(objectMap, "tail", d.Tail) + populate(objectMap, "dataType", d.DataType) + populate(objectMap, "description", d.Description) + populate(objectMap, "isArchived", d.IsArchived) + populate(objectMap, "latestVersion", d.LatestVersion) + populate(objectMap, "nextVersion", d.NextVersion) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentLogsRequest. -func (d *DeploymentLogsRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataContainerProperties. +func (d *DataContainerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5122,11 +5954,26 @@ func (d *DeploymentLogsRequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "containerType": - err = unpopulate(val, "ContainerType", &d.ContainerType) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) delete(rawMsg, key) - case "tail": - err = unpopulate(val, "Tail", &d.Tail) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &d.IsArchived) + delete(rawMsg, key) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &d.LatestVersion) + delete(rawMsg, key) + case "nextVersion": + err = unpopulate(val, "NextVersion", &d.NextVersion) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { @@ -5136,17 +5983,16 @@ func (d *DeploymentLogsRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentResourceConfiguration. -func (d DeploymentResourceConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataContainerResourceArmPaginatedResult. +func (d DataContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "instanceCount", d.InstanceCount) - populate(objectMap, "instanceType", d.InstanceType) - populate(objectMap, "properties", d.Properties) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceConfiguration. -func (d *DeploymentResourceConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataContainerResourceArmPaginatedResult. +func (d *DataContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5154,14 +6000,11 @@ func (d *DeploymentResourceConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "instanceCount": - err = unpopulate(val, "InstanceCount", &d.InstanceCount) - delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &d.InstanceType) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { @@ -5171,23 +6014,16 @@ func (d *DeploymentResourceConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnoseRequestProperties. -func (d DiagnoseRequestProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataDriftMetricThresholdBase. +func (d DataDriftMetricThresholdBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationInsights", d.ApplicationInsights) - populate(objectMap, "containerRegistry", d.ContainerRegistry) - populate(objectMap, "dnsResolution", d.DNSResolution) - populate(objectMap, "keyVault", d.KeyVault) - populate(objectMap, "nsg", d.Nsg) - populate(objectMap, "others", d.Others) - populate(objectMap, "resourceLock", d.ResourceLock) - populate(objectMap, "storageAccount", d.StorageAccount) - populate(objectMap, "udr", d.Udr) + objectMap["dataType"] = d.DataType + populate(objectMap, "threshold", d.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseRequestProperties. -func (d *DiagnoseRequestProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataDriftMetricThresholdBase. +func (d *DataDriftMetricThresholdBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5195,32 +6031,11 @@ func (d *DiagnoseRequestProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "applicationInsights": - err = unpopulate(val, "ApplicationInsights", &d.ApplicationInsights) - delete(rawMsg, key) - case "containerRegistry": - err = unpopulate(val, "ContainerRegistry", &d.ContainerRegistry) - delete(rawMsg, key) - case "dnsResolution": - err = unpopulate(val, "DNSResolution", &d.DNSResolution) - delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &d.KeyVault) - delete(rawMsg, key) - case "nsg": - err = unpopulate(val, "Nsg", &d.Nsg) - delete(rawMsg, key) - case "others": - err = unpopulate(val, "Others", &d.Others) - delete(rawMsg, key) - case "resourceLock": - err = unpopulate(val, "ResourceLock", &d.ResourceLock) - delete(rawMsg, key) - case "storageAccount": - err = unpopulate(val, "StorageAccount", &d.StorageAccount) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) delete(rawMsg, key) - case "udr": - err = unpopulate(val, "Udr", &d.Udr) + case "threshold": + err = unpopulate(val, "Threshold", &d.Threshold) delete(rawMsg, key) } if err != nil { @@ -5230,15 +6045,24 @@ func (d *DiagnoseRequestProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnoseResponseResult. -func (d DiagnoseResponseResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataDriftMonitoringSignal. +func (d DataDriftMonitoringSignal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) + populate(objectMap, "dataSegment", d.DataSegment) + populate(objectMap, "featureDataTypeOverride", d.FeatureDataTypeOverride) + populate(objectMap, "featureImportanceSettings", d.FeatureImportanceSettings) + populate(objectMap, "features", d.Features) + populate(objectMap, "metricThresholds", d.MetricThresholds) + populate(objectMap, "notificationTypes", d.NotificationTypes) + populate(objectMap, "productionData", d.ProductionData) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "referenceData", d.ReferenceData) + objectMap["signalType"] = MonitoringSignalTypeDataDrift return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseResponseResult. -func (d *DiagnoseResponseResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataDriftMonitoringSignal. +func (d *DataDriftMonitoringSignal) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5246,8 +6070,35 @@ func (d *DiagnoseResponseResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &d.Value) + case "dataSegment": + err = unpopulate(val, "DataSegment", &d.DataSegment) + delete(rawMsg, key) + case "featureDataTypeOverride": + err = unpopulate(val, "FeatureDataTypeOverride", &d.FeatureDataTypeOverride) + delete(rawMsg, key) + case "featureImportanceSettings": + err = unpopulate(val, "FeatureImportanceSettings", &d.FeatureImportanceSettings) + delete(rawMsg, key) + case "features": + d.Features, err = unmarshalMonitoringFeatureFilterBaseClassification(val) + delete(rawMsg, key) + case "metricThresholds": + d.MetricThresholds, err = unmarshalDataDriftMetricThresholdBaseClassificationArray(val) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &d.NotificationTypes) + delete(rawMsg, key) + case "productionData": + d.ProductionData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "referenceData": + d.ReferenceData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &d.SignalType) delete(rawMsg, key) } if err != nil { @@ -5257,23 +6108,24 @@ func (d *DiagnoseResponseResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnoseResponseResultValue. -func (d DiagnoseResponseResultValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataFactory. +func (d DataFactory) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "applicationInsightsResults", d.ApplicationInsightsResults) - populate(objectMap, "containerRegistryResults", d.ContainerRegistryResults) - populate(objectMap, "dnsResolutionResults", d.DNSResolutionResults) - populate(objectMap, "keyVaultResults", d.KeyVaultResults) - populate(objectMap, "networkSecurityRuleResults", d.NetworkSecurityRuleResults) - populate(objectMap, "otherResults", d.OtherResults) - populate(objectMap, "resourceLockResults", d.ResourceLockResults) - populate(objectMap, "storageAccountResults", d.StorageAccountResults) - populate(objectMap, "userDefinedRouteResults", d.UserDefinedRouteResults) + populate(objectMap, "computeLocation", d.ComputeLocation) + objectMap["computeType"] = ComputeTypeDataFactory + populateDateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) + populate(objectMap, "description", d.Description) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) + populate(objectMap, "provisioningErrors", d.ProvisioningErrors) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceId", d.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseResponseResultValue. -func (d *DiagnoseResponseResultValue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataFactory. +func (d *DataFactory) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5281,32 +6133,35 @@ func (d *DiagnoseResponseResultValue) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "applicationInsightsResults": - err = unpopulate(val, "ApplicationInsightsResults", &d.ApplicationInsightsResults) + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) delete(rawMsg, key) - case "containerRegistryResults": - err = unpopulate(val, "ContainerRegistryResults", &d.ContainerRegistryResults) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) delete(rawMsg, key) - case "dnsResolutionResults": - err = unpopulate(val, "DNSResolutionResults", &d.DNSResolutionResults) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) delete(rawMsg, key) - case "keyVaultResults": - err = unpopulate(val, "KeyVaultResults", &d.KeyVaultResults) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "networkSecurityRuleResults": - err = unpopulate(val, "NetworkSecurityRuleResults", &d.NetworkSecurityRuleResults) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) - case "otherResults": - err = unpopulate(val, "OtherResults", &d.OtherResults) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) delete(rawMsg, key) - case "resourceLockResults": - err = unpopulate(val, "ResourceLockResults", &d.ResourceLockResults) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) delete(rawMsg, key) - case "storageAccountResults": - err = unpopulate(val, "StorageAccountResults", &d.StorageAccountResults) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) delete(rawMsg, key) - case "userDefinedRouteResults": - err = unpopulate(val, "UserDefinedRouteResults", &d.UserDefinedRouteResults) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) delete(rawMsg, key) } if err != nil { @@ -5316,17 +6171,26 @@ func (d *DiagnoseResponseResultValue) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnoseResult. -func (d DiagnoseResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataImport. +func (d DataImport) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", d.Code) - populate(objectMap, "level", d.Level) - populate(objectMap, "message", d.Message) + populate(objectMap, "assetName", d.AssetName) + populate(objectMap, "autoDeleteSetting", d.AutoDeleteSetting) + objectMap["dataType"] = DataTypeURIFolder + populate(objectMap, "dataUri", d.DataURI) + populate(objectMap, "description", d.Description) + populate(objectMap, "intellectualProperty", d.IntellectualProperty) + populate(objectMap, "isAnonymous", d.IsAnonymous) + populate(objectMap, "isArchived", d.IsArchived) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "source", d.Source) + populate(objectMap, "stage", d.Stage) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseResult. -func (d *DiagnoseResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataImport. +func (d *DataImport) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5334,14 +6198,41 @@ func (d *DiagnoseResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &d.Code) + case "assetName": + err = unpopulate(val, "AssetName", &d.AssetName) delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &d.Level) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &d.AutoDeleteSetting) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &d.Message) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) + delete(rawMsg, key) + case "dataUri": + err = unpopulate(val, "DataURI", &d.DataURI) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &d.IntellectualProperty) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &d.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &d.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "source": + d.Source, err = unmarshalDataImportSourceClassification(val) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &d.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { @@ -5351,15 +6242,16 @@ func (d *DiagnoseResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnoseWorkspaceParameters. -func (d DiagnoseWorkspaceParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataImportSource. +func (d DataImportSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) + populate(objectMap, "connection", d.Connection) + objectMap["sourceType"] = d.SourceType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseWorkspaceParameters. -func (d *DiagnoseWorkspaceParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataImportSource. +func (d *DataImportSource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5367,8 +6259,11 @@ func (d *DiagnoseWorkspaceParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &d.Value) + case "connection": + err = unpopulate(val, "Connection", &d.Connection) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &d.SourceType) delete(rawMsg, key) } if err != nil { @@ -5378,15 +6273,25 @@ func (d *DiagnoseWorkspaceParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DistributionConfiguration. -func (d DistributionConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalytics. +func (d DataLakeAnalytics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["distributionType"] = d.DistributionType + populate(objectMap, "computeLocation", d.ComputeLocation) + objectMap["computeType"] = ComputeTypeDataLakeAnalytics + populateDateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) + populate(objectMap, "description", d.Description) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "provisioningErrors", d.ProvisioningErrors) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceId", d.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DistributionConfiguration. -func (d *DistributionConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalytics. +func (d *DataLakeAnalytics) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5394,8 +6299,38 @@ func (d *DistributionConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "distributionType": - err = unpopulate(val, "DistributionType", &d.DistributionType) + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) delete(rawMsg, key) } if err != nil { @@ -5405,6874 +6340,15259 @@ func (d *DistributionConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EarlyTerminationPolicy. -func (e EarlyTerminationPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalyticsSchema. +func (d DataLakeAnalyticsSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "delayEvaluation", e.DelayEvaluation) - populate(objectMap, "evaluationInterval", e.EvaluationInterval) - objectMap["policyType"] = e.PolicyType + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EarlyTerminationPolicy. -func (e *EarlyTerminationPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalyticsSchema. +func (d *DataLakeAnalyticsSchema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "delayEvaluation": - err = unpopulate(val, "DelayEvaluation", &e.DelayEvaluation) - delete(rawMsg, key) - case "evaluationInterval": - err = unpopulate(val, "EvaluationInterval", &e.EvaluationInterval) - delete(rawMsg, key) - case "policyType": - err = unpopulate(val, "PolicyType", &e.PolicyType) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionKeyVaultProperties. -func (e EncryptionKeyVaultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalyticsSchemaProperties. +func (d DataLakeAnalyticsSchemaProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identityClientId", e.IdentityClientID) - populate(objectMap, "keyIdentifier", e.KeyIdentifier) - populate(objectMap, "keyVaultArmId", e.KeyVaultArmID) + populate(objectMap, "dataLakeStoreAccountName", d.DataLakeStoreAccountName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionKeyVaultProperties. -func (e *EncryptionKeyVaultProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalyticsSchemaProperties. +func (d *DataLakeAnalyticsSchemaProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "identityClientId": - err = unpopulate(val, "IdentityClientID", &e.IdentityClientID) - delete(rawMsg, key) - case "keyIdentifier": - err = unpopulate(val, "KeyIdentifier", &e.KeyIdentifier) - delete(rawMsg, key) - case "keyVaultArmId": - err = unpopulate(val, "KeyVaultArmID", &e.KeyVaultArmID) + case "dataLakeStoreAccountName": + err = unpopulate(val, "DataLakeStoreAccountName", &d.DataLakeStoreAccountName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionProperty. -func (e EncryptionProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataPathAssetReference. +func (d DataPathAssetReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", e.Identity) - populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) - populate(objectMap, "status", e.Status) + populate(objectMap, "datastoreId", d.DatastoreID) + populate(objectMap, "path", d.Path) + objectMap["referenceType"] = ReferenceTypeDataPath return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperty. -func (e *EncryptionProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataPathAssetReference. +func (d *DataPathAssetReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &e.Identity) + case "datastoreId": + err = unpopulate(val, "DatastoreID", &d.DatastoreID) delete(rawMsg, key) - case "keyVaultProperties": - err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + case "path": + err = unpopulate(val, "Path", &d.Path) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) + case "referenceType": + err = unpopulate(val, "ReferenceType", &d.ReferenceType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointAuthKeys. -func (e EndpointAuthKeys) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataQualityMetricThresholdBase. +func (d DataQualityMetricThresholdBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "primaryKey", e.PrimaryKey) - populate(objectMap, "secondaryKey", e.SecondaryKey) + objectMap["dataType"] = d.DataType + populate(objectMap, "threshold", d.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointAuthKeys. -func (e *EndpointAuthKeys) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataQualityMetricThresholdBase. +func (d *DataQualityMetricThresholdBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "primaryKey": - err = unpopulate(val, "PrimaryKey", &e.PrimaryKey) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) delete(rawMsg, key) - case "secondaryKey": - err = unpopulate(val, "SecondaryKey", &e.SecondaryKey) + case "threshold": + err = unpopulate(val, "Threshold", &d.Threshold) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointAuthToken. -func (e EndpointAuthToken) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataQualityMonitoringSignal. +func (d DataQualityMonitoringSignal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessToken", e.AccessToken) - populate(objectMap, "expiryTimeUtc", e.ExpiryTimeUTC) - populate(objectMap, "refreshAfterTimeUtc", e.RefreshAfterTimeUTC) - populate(objectMap, "tokenType", e.TokenType) + populate(objectMap, "featureDataTypeOverride", d.FeatureDataTypeOverride) + populate(objectMap, "featureImportanceSettings", d.FeatureImportanceSettings) + populate(objectMap, "features", d.Features) + populate(objectMap, "metricThresholds", d.MetricThresholds) + populate(objectMap, "notificationTypes", d.NotificationTypes) + populate(objectMap, "productionData", d.ProductionData) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "referenceData", d.ReferenceData) + objectMap["signalType"] = MonitoringSignalTypeDataQuality return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointAuthToken. -func (e *EndpointAuthToken) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataQualityMonitoringSignal. +func (d *DataQualityMonitoringSignal) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "accessToken": - err = unpopulate(val, "AccessToken", &e.AccessToken) + case "featureDataTypeOverride": + err = unpopulate(val, "FeatureDataTypeOverride", &d.FeatureDataTypeOverride) delete(rawMsg, key) - case "expiryTimeUtc": - err = unpopulate(val, "ExpiryTimeUTC", &e.ExpiryTimeUTC) + case "featureImportanceSettings": + err = unpopulate(val, "FeatureImportanceSettings", &d.FeatureImportanceSettings) delete(rawMsg, key) - case "refreshAfterTimeUtc": - err = unpopulate(val, "RefreshAfterTimeUTC", &e.RefreshAfterTimeUTC) + case "features": + d.Features, err = unmarshalMonitoringFeatureFilterBaseClassification(val) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &e.TokenType) + case "metricThresholds": + d.MetricThresholds, err = unmarshalDataQualityMetricThresholdBaseClassificationArray(val) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &d.NotificationTypes) + delete(rawMsg, key) + case "productionData": + d.ProductionData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "referenceData": + d.ReferenceData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &d.SignalType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointDeploymentPropertiesBase. -func (e EndpointDeploymentPropertiesBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataReferenceCredential. +func (d DataReferenceCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "codeConfiguration", e.CodeConfiguration) - populate(objectMap, "description", e.Description) - populate(objectMap, "environmentId", e.EnvironmentID) - populate(objectMap, "environmentVariables", e.EnvironmentVariables) - populate(objectMap, "properties", e.Properties) + objectMap["credentialType"] = d.CredentialType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDeploymentPropertiesBase. -func (e *EndpointDeploymentPropertiesBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataReferenceCredential. +func (d *DataReferenceCredential) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "codeConfiguration": - err = unpopulate(val, "CodeConfiguration", &e.CodeConfiguration) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &e.EnvironmentID) - delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &e.EnvironmentVariables) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "credentialType": + err = unpopulate(val, "CredentialType", &d.CredentialType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesBase. -func (e EndpointPropertiesBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataVersionBase. +func (d DataVersionBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authMode", e.AuthMode) - populate(objectMap, "description", e.Description) - populate(objectMap, "keys", e.Keys) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "scoringUri", e.ScoringURI) - populate(objectMap, "swaggerUri", e.SwaggerURI) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesBase. -func (e *EndpointPropertiesBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBase. +func (d *DataVersionBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "authMode": - err = unpopulate(val, "AuthMode", &e.AuthMode) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &e.Description) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "keys": - err = unpopulate(val, "Keys", &e.Keys) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + d.Properties, err = unmarshalDataVersionBasePropertiesClassification(val) delete(rawMsg, key) - case "scoringUri": - err = unpopulate(val, "ScoringURI", &e.ScoringURI) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "swaggerUri": - err = unpopulate(val, "SwaggerURI", &e.SwaggerURI) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointScheduleAction. -func (e EndpointScheduleAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataVersionBaseProperties. +func (d DataVersionBaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["actionType"] = ScheduleActionTypeInvokeBatchEndpoint - populateAny(objectMap, "endpointInvocationDefinition", e.EndpointInvocationDefinition) + populate(objectMap, "autoDeleteSetting", d.AutoDeleteSetting) + objectMap["dataType"] = d.DataType + populate(objectMap, "dataUri", d.DataURI) + populate(objectMap, "description", d.Description) + populate(objectMap, "intellectualProperty", d.IntellectualProperty) + populate(objectMap, "isAnonymous", d.IsAnonymous) + populate(objectMap, "isArchived", d.IsArchived) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "stage", d.Stage) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointScheduleAction. -func (e *EndpointScheduleAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionType": - err = unpopulate(val, "ActionType", &e.ActionType) - delete(rawMsg, key) - case "endpointInvocationDefinition": - err = unpopulate(val, "EndpointInvocationDefinition", &e.EndpointInvocationDefinition) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainer. -func (e EnvironmentContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentContainer. -func (e *EnvironmentContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBaseProperties. +func (d *DataVersionBaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &d.AutoDeleteSetting) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "dataUri": + err = unpopulate(val, "DataURI", &d.DataURI) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainerProperties. -func (e EnvironmentContainerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", e.Description) - populate(objectMap, "isArchived", e.IsArchived) - populate(objectMap, "latestVersion", e.LatestVersion) - populate(objectMap, "nextVersion", e.NextVersion) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentContainerProperties. -func (e *EnvironmentContainerProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { case "description": - err = unpopulate(val, "Description", &e.Description) + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &e.IsArchived) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &d.IntellectualProperty) delete(rawMsg, key) - case "latestVersion": - err = unpopulate(val, "LatestVersion", &e.LatestVersion) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &d.IsAnonymous) delete(rawMsg, key) - case "nextVersion": - err = unpopulate(val, "NextVersion", &e.NextVersion) + case "isArchived": + err = unpopulate(val, "IsArchived", &d.IsArchived) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &d.Stage) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &e.Tags) + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainerResourceArmPaginatedResult. -func (e EnvironmentContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataVersionBaseResourceArmPaginatedResult. +func (d DataVersionBaseResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentContainerResourceArmPaginatedResult. -func (e *EnvironmentContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataVersionBaseResourceArmPaginatedResult. +func (d *DataVersionBaseResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &e.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersion. -func (e EnvironmentVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseSource. +func (d DatabaseSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) + populate(objectMap, "connection", d.Connection) + populate(objectMap, "query", d.Query) + objectMap["sourceType"] = DataImportSourceTypeDatabase + populate(objectMap, "storedProcedure", d.StoredProcedure) + populate(objectMap, "storedProcedureParams", d.StoredProcedureParams) + populate(objectMap, "tableName", d.TableName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVersion. -func (e *EnvironmentVersion) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSource. +func (d *DatabaseSource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) + case "connection": + err = unpopulate(val, "Connection", &d.Connection) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) + case "query": + err = unpopulate(val, "Query", &d.Query) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "sourceType": + err = unpopulate(val, "SourceType", &d.SourceType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) + case "storedProcedure": + err = unpopulate(val, "StoredProcedure", &d.StoredProcedure) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "storedProcedureParams": + err = unpopulate(val, "StoredProcedureParams", &d.StoredProcedureParams) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &d.TableName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersionProperties. -func (e EnvironmentVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Databricks. +func (d Databricks) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoRebuild", e.AutoRebuild) - populate(objectMap, "build", e.Build) - populate(objectMap, "condaFile", e.CondaFile) - populate(objectMap, "description", e.Description) - populate(objectMap, "environmentType", e.EnvironmentType) - populate(objectMap, "image", e.Image) - populate(objectMap, "inferenceConfig", e.InferenceConfig) - populate(objectMap, "isAnonymous", e.IsAnonymous) - populate(objectMap, "isArchived", e.IsArchived) - populate(objectMap, "osType", e.OSType) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) + populate(objectMap, "computeLocation", d.ComputeLocation) + objectMap["computeType"] = ComputeTypeDatabricks + populateDateTimeRFC3339(objectMap, "createdOn", d.CreatedOn) + populate(objectMap, "description", d.Description) + populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", d.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", d.ModifiedOn) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "provisioningErrors", d.ProvisioningErrors) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "resourceId", d.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVersionProperties. -func (e *EnvironmentVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Databricks. +func (d *Databricks) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "autoRebuild": - err = unpopulate(val, "AutoRebuild", &e.AutoRebuild) + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &d.ComputeLocation) delete(rawMsg, key) - case "build": - err = unpopulate(val, "Build", &e.Build) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) delete(rawMsg, key) - case "condaFile": - err = unpopulate(val, "CondaFile", &e.CondaFile) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &d.CreatedOn) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "environmentType": - err = unpopulate(val, "EnvironmentType", &e.EnvironmentType) + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &e.Image) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) - case "inferenceConfig": - err = unpopulate(val, "InferenceConfig", &e.InferenceConfig) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &d.IsAttachedCompute) delete(rawMsg, key) - case "isAnonymous": - err = unpopulate(val, "IsAnonymous", &e.IsAnonymous) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &d.ModifiedOn) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &e.IsArchived) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &e.OSType) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &d.ProvisioningErrors) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) + case "resourceId": + err = unpopulate(val, "ResourceID", &d.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersionResourceArmPaginatedResult. -func (e EnvironmentVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabricksComputeSecrets. +func (d DatabricksComputeSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + objectMap["computeType"] = ComputeTypeDatabricks + populate(objectMap, "databricksAccessToken", d.DatabricksAccessToken) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVersionResourceArmPaginatedResult. -func (e *EnvironmentVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksComputeSecrets. +func (d *DatabricksComputeSecrets) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) + case "computeType": + err = unpopulate(val, "ComputeType", &d.ComputeType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "databricksAccessToken": + err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabricksComputeSecretsProperties. +func (d DatabricksComputeSecretsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) + populate(objectMap, "databricksAccessToken", d.DatabricksAccessToken) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksComputeSecretsProperties. +func (d *DatabricksComputeSecretsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "info": - err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "databricksAccessToken": + err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabricksProperties. +func (d DatabricksProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "databricksAccessToken", d.DatabricksAccessToken) + populate(objectMap, "workspaceUrl", d.WorkspaceURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. -func (e *ErrorDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksProperties. +func (d *DatabricksProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "databricksAccessToken": + err = unpopulate(val, "DatabricksAccessToken", &d.DatabricksAccessToken) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "workspaceUrl": + err = unpopulate(val, "WorkspaceURL", &d.WorkspaceURL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabricksSchema. +func (d DatabricksSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksSchema. +func (d *DatabricksSchema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EstimatedVMPrice. -func (e EstimatedVMPrice) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatasetExportSummary. +func (d DatasetExportSummary) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "osType", e.OSType) - populate(objectMap, "retailPrice", e.RetailPrice) - populate(objectMap, "vmTier", e.VMTier) + populateDateTimeRFC3339(objectMap, "endDateTime", d.EndDateTime) + populate(objectMap, "exportedRowCount", d.ExportedRowCount) + objectMap["format"] = ExportFormatTypeDataset + populate(objectMap, "labeledAssetName", d.LabeledAssetName) + populate(objectMap, "labelingJobId", d.LabelingJobID) + populateDateTimeRFC3339(objectMap, "startDateTime", d.StartDateTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EstimatedVMPrice. -func (e *EstimatedVMPrice) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatasetExportSummary. +func (d *DatasetExportSummary) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "osType": - err = unpopulate(val, "OSType", &e.OSType) + case "endDateTime": + err = unpopulateDateTimeRFC3339(val, "EndDateTime", &d.EndDateTime) delete(rawMsg, key) - case "retailPrice": - err = unpopulate(val, "RetailPrice", &e.RetailPrice) + case "exportedRowCount": + err = unpopulate(val, "ExportedRowCount", &d.ExportedRowCount) delete(rawMsg, key) - case "vmTier": - err = unpopulate(val, "VMTier", &e.VMTier) + case "format": + err = unpopulate(val, "Format", &d.Format) + delete(rawMsg, key) + case "labeledAssetName": + err = unpopulate(val, "LabeledAssetName", &d.LabeledAssetName) + delete(rawMsg, key) + case "labelingJobId": + err = unpopulate(val, "LabelingJobID", &d.LabelingJobID) + delete(rawMsg, key) + case "startDateTime": + err = unpopulateDateTimeRFC3339(val, "StartDateTime", &d.StartDateTime) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EstimatedVMPrices. -func (e EstimatedVMPrices) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Datastore. +func (d Datastore) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "billingCurrency", e.BillingCurrency) - populate(objectMap, "unitOfMeasure", e.UnitOfMeasure) - populate(objectMap, "values", e.Values) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EstimatedVMPrices. -func (e *EstimatedVMPrices) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Datastore. +func (d *Datastore) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "billingCurrency": - err = unpopulate(val, "BillingCurrency", &e.BillingCurrency) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "unitOfMeasure": - err = unpopulate(val, "UnitOfMeasure", &e.UnitOfMeasure) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &e.Values) + case "properties": + d.Properties, err = unmarshalDatastorePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalFQDNResponse. -func (e ExternalFQDNResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatastoreCredentials. +func (d DatastoreCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", e.Value) + objectMap["credentialsType"] = d.CredentialsType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalFQDNResponse. -func (e *ExternalFQDNResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreCredentials. +func (d *DatastoreCredentials) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &e.Value) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &d.CredentialsType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FQDNEndpoint. -func (f FQDNEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatastoreProperties. +func (d DatastoreProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "domainName", f.DomainName) - populate(objectMap, "endpointDetails", f.EndpointDetails) + populate(objectMap, "credentials", d.Credentials) + objectMap["datastoreType"] = d.DatastoreType + populate(objectMap, "description", d.Description) + populate(objectMap, "intellectualProperty", d.IntellectualProperty) + populate(objectMap, "isDefault", d.IsDefault) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpoint. -func (f *FQDNEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreProperties. +func (d *DatastoreProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "domainName": - err = unpopulate(val, "DomainName", &f.DomainName) + case "credentials": + d.Credentials, err = unmarshalDatastoreCredentialsClassification(val) delete(rawMsg, key) - case "endpointDetails": - err = unpopulate(val, "EndpointDetails", &f.EndpointDetails) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &d.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &d.IntellectualProperty) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &d.IsDefault) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FQDNEndpointDetail. -func (f FQDNEndpointDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatastoreResourceArmPaginatedResult. +func (d DatastoreResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "port", f.Port) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpointDetail. -func (f *FQDNEndpointDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreResourceArmPaginatedResult. +func (d *DatastoreResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "port": - err = unpopulate(val, "Port", &f.Port) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FQDNEndpoints. -func (f FQDNEndpoints) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatastoreSecrets. +func (d DatastoreSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", f.Properties) + objectMap["secretsType"] = d.SecretsType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpoints. -func (f *FQDNEndpoints) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatastoreSecrets. +func (d *DatastoreSecrets) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &f.Properties) + case "secretsType": + err = unpopulate(val, "SecretsType", &d.SecretsType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FQDNEndpointsProperties. -func (f FQDNEndpointsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefaultScaleSettings. +func (d DefaultScaleSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "category", f.Category) - populate(objectMap, "endpoints", f.Endpoints) + objectMap["scaleType"] = ScaleTypeDefault return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpointsProperties. -func (f *FQDNEndpointsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultScaleSettings. +func (d *DefaultScaleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "category": - err = unpopulate(val, "Category", &f.Category) - delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &f.Endpoints) + case "scaleType": + err = unpopulate(val, "ScaleType", &d.ScaleType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FeaturizationSettings. -func (f FeaturizationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeploymentLogs. +func (d DeploymentLogs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "datasetLanguage", f.DatasetLanguage) + populate(objectMap, "content", d.Content) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturizationSettings. -func (f *FeaturizationSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentLogs. +func (d *DeploymentLogs) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "datasetLanguage": - err = unpopulate(val, "DatasetLanguage", &f.DatasetLanguage) + case "content": + err = unpopulate(val, "Content", &d.Content) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FlavorData. -func (f FlavorData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeploymentLogsRequest. +func (d DeploymentLogsRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "data", f.Data) + populate(objectMap, "containerType", d.ContainerType) + populate(objectMap, "tail", d.Tail) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FlavorData. -func (f *FlavorData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentLogsRequest. +func (d *DeploymentLogsRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "data": - err = unpopulate(val, "Data", &f.Data) + case "containerType": + err = unpopulate(val, "ContainerType", &d.ContainerType) + delete(rawMsg, key) + case "tail": + err = unpopulate(val, "Tail", &d.Tail) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ForecastHorizon. -func (f ForecastHorizon) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeploymentResourceConfiguration. +func (d DeploymentResourceConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = f.Mode + populate(objectMap, "instanceCount", d.InstanceCount) + populate(objectMap, "instanceType", d.InstanceType) + populate(objectMap, "locations", d.Locations) + populate(objectMap, "maxInstanceCount", d.MaxInstanceCount) + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ForecastHorizon. -func (f *ForecastHorizon) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceConfiguration. +func (d *DeploymentResourceConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &f.Mode) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &d.InstanceCount) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &d.InstanceType) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) + delete(rawMsg, key) + case "maxInstanceCount": + err = unpopulate(val, "MaxInstanceCount", &d.MaxInstanceCount) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Forecasting. -func (f Forecasting) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DestinationAsset. +func (d DestinationAsset) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cvSplitColumnNames", f.CvSplitColumnNames) - populate(objectMap, "featurizationSettings", f.FeaturizationSettings) - populate(objectMap, "forecastingSettings", f.ForecastingSettings) - populate(objectMap, "limitSettings", f.LimitSettings) - populate(objectMap, "logVerbosity", f.LogVerbosity) - populate(objectMap, "nCrossValidations", f.NCrossValidations) - populate(objectMap, "primaryMetric", f.PrimaryMetric) - populate(objectMap, "targetColumnName", f.TargetColumnName) - objectMap["taskType"] = TaskTypeForecasting - populate(objectMap, "testData", f.TestData) - populate(objectMap, "testDataSize", f.TestDataSize) - populate(objectMap, "trainingData", f.TrainingData) - populate(objectMap, "trainingSettings", f.TrainingSettings) - populate(objectMap, "validationData", f.ValidationData) - populate(objectMap, "validationDataSize", f.ValidationDataSize) - populate(objectMap, "weightColumnName", f.WeightColumnName) + populate(objectMap, "destinationName", d.DestinationName) + populate(objectMap, "destinationVersion", d.DestinationVersion) + populate(objectMap, "registryName", d.RegistryName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Forecasting. -func (f *Forecasting) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DestinationAsset. +func (d *DestinationAsset) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "cvSplitColumnNames": - err = unpopulate(val, "CvSplitColumnNames", &f.CvSplitColumnNames) - delete(rawMsg, key) - case "featurizationSettings": - err = unpopulate(val, "FeaturizationSettings", &f.FeaturizationSettings) - delete(rawMsg, key) - case "forecastingSettings": - err = unpopulate(val, "ForecastingSettings", &f.ForecastingSettings) - delete(rawMsg, key) - case "limitSettings": - err = unpopulate(val, "LimitSettings", &f.LimitSettings) - delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &f.LogVerbosity) - delete(rawMsg, key) - case "nCrossValidations": - f.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) - delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &f.PrimaryMetric) - delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &f.TargetColumnName) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &f.TaskType) - delete(rawMsg, key) - case "testData": - err = unpopulate(val, "TestData", &f.TestData) - delete(rawMsg, key) - case "testDataSize": - err = unpopulate(val, "TestDataSize", &f.TestDataSize) - delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &f.TrainingData) + case "destinationName": + err = unpopulate(val, "DestinationName", &d.DestinationName) delete(rawMsg, key) - case "trainingSettings": - err = unpopulate(val, "TrainingSettings", &f.TrainingSettings) - delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &f.ValidationData) - delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &f.ValidationDataSize) + case "destinationVersion": + err = unpopulate(val, "DestinationVersion", &d.DestinationVersion) delete(rawMsg, key) - case "weightColumnName": - err = unpopulate(val, "WeightColumnName", &f.WeightColumnName) + case "registryName": + err = unpopulate(val, "RegistryName", &d.RegistryName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ForecastingSettings. -func (f ForecastingSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnoseRequestProperties. +func (d DiagnoseRequestProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "countryOrRegionForHolidays", f.CountryOrRegionForHolidays) - populate(objectMap, "cvStepSize", f.CvStepSize) - populate(objectMap, "featureLags", f.FeatureLags) - populate(objectMap, "forecastHorizon", f.ForecastHorizon) - populate(objectMap, "frequency", f.Frequency) - populate(objectMap, "seasonality", f.Seasonality) - populate(objectMap, "shortSeriesHandlingConfig", f.ShortSeriesHandlingConfig) - populate(objectMap, "targetAggregateFunction", f.TargetAggregateFunction) - populate(objectMap, "targetLags", f.TargetLags) - populate(objectMap, "targetRollingWindowSize", f.TargetRollingWindowSize) - populate(objectMap, "timeColumnName", f.TimeColumnName) - populate(objectMap, "timeSeriesIdColumnNames", f.TimeSeriesIDColumnNames) - populate(objectMap, "useStl", f.UseStl) + populate(objectMap, "applicationInsights", d.ApplicationInsights) + populate(objectMap, "containerRegistry", d.ContainerRegistry) + populate(objectMap, "dnsResolution", d.DNSResolution) + populate(objectMap, "keyVault", d.KeyVault) + populate(objectMap, "nsg", d.Nsg) + populate(objectMap, "others", d.Others) + populate(objectMap, "requiredResourceProviders", d.RequiredResourceProviders) + populate(objectMap, "resourceLock", d.ResourceLock) + populate(objectMap, "storageAccount", d.StorageAccount) + populate(objectMap, "udr", d.Udr) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ForecastingSettings. -func (f *ForecastingSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseRequestProperties. +func (d *DiagnoseRequestProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "countryOrRegionForHolidays": - err = unpopulate(val, "CountryOrRegionForHolidays", &f.CountryOrRegionForHolidays) - delete(rawMsg, key) - case "cvStepSize": - err = unpopulate(val, "CvStepSize", &f.CvStepSize) - delete(rawMsg, key) - case "featureLags": - err = unpopulate(val, "FeatureLags", &f.FeatureLags) - delete(rawMsg, key) - case "forecastHorizon": - f.ForecastHorizon, err = unmarshalForecastHorizonClassification(val) + case "applicationInsights": + err = unpopulate(val, "ApplicationInsights", &d.ApplicationInsights) delete(rawMsg, key) - case "frequency": - err = unpopulate(val, "Frequency", &f.Frequency) + case "containerRegistry": + err = unpopulate(val, "ContainerRegistry", &d.ContainerRegistry) delete(rawMsg, key) - case "seasonality": - f.Seasonality, err = unmarshalSeasonalityClassification(val) + case "dnsResolution": + err = unpopulate(val, "DNSResolution", &d.DNSResolution) delete(rawMsg, key) - case "shortSeriesHandlingConfig": - err = unpopulate(val, "ShortSeriesHandlingConfig", &f.ShortSeriesHandlingConfig) + case "keyVault": + err = unpopulate(val, "KeyVault", &d.KeyVault) delete(rawMsg, key) - case "targetAggregateFunction": - err = unpopulate(val, "TargetAggregateFunction", &f.TargetAggregateFunction) + case "nsg": + err = unpopulate(val, "Nsg", &d.Nsg) delete(rawMsg, key) - case "targetLags": - f.TargetLags, err = unmarshalTargetLagsClassification(val) + case "others": + err = unpopulate(val, "Others", &d.Others) delete(rawMsg, key) - case "targetRollingWindowSize": - f.TargetRollingWindowSize, err = unmarshalTargetRollingWindowSizeClassification(val) + case "requiredResourceProviders": + err = unpopulate(val, "RequiredResourceProviders", &d.RequiredResourceProviders) delete(rawMsg, key) - case "timeColumnName": - err = unpopulate(val, "TimeColumnName", &f.TimeColumnName) + case "resourceLock": + err = unpopulate(val, "ResourceLock", &d.ResourceLock) delete(rawMsg, key) - case "timeSeriesIdColumnNames": - err = unpopulate(val, "TimeSeriesIDColumnNames", &f.TimeSeriesIDColumnNames) + case "storageAccount": + err = unpopulate(val, "StorageAccount", &d.StorageAccount) delete(rawMsg, key) - case "useStl": - err = unpopulate(val, "UseStl", &f.UseStl) + case "udr": + err = unpopulate(val, "Udr", &d.Udr) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ForecastingTrainingSettings. -func (f ForecastingTrainingSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnoseResponseResult. +func (d DiagnoseResponseResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTrainingAlgorithms", f.AllowedTrainingAlgorithms) - populate(objectMap, "blockedTrainingAlgorithms", f.BlockedTrainingAlgorithms) - populate(objectMap, "enableDnnTraining", f.EnableDnnTraining) - populate(objectMap, "enableModelExplainability", f.EnableModelExplainability) - populate(objectMap, "enableOnnxCompatibleModels", f.EnableOnnxCompatibleModels) - populate(objectMap, "enableStackEnsemble", f.EnableStackEnsemble) - populate(objectMap, "enableVoteEnsemble", f.EnableVoteEnsemble) - populate(objectMap, "ensembleModelDownloadTimeout", f.EnsembleModelDownloadTimeout) - populate(objectMap, "stackEnsembleSettings", f.StackEnsembleSettings) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ForecastingTrainingSettings. -func (f *ForecastingTrainingSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseResponseResult. +func (d *DiagnoseResponseResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "allowedTrainingAlgorithms": - err = unpopulate(val, "AllowedTrainingAlgorithms", &f.AllowedTrainingAlgorithms) - delete(rawMsg, key) - case "blockedTrainingAlgorithms": - err = unpopulate(val, "BlockedTrainingAlgorithms", &f.BlockedTrainingAlgorithms) - delete(rawMsg, key) - case "enableDnnTraining": - err = unpopulate(val, "EnableDnnTraining", &f.EnableDnnTraining) - delete(rawMsg, key) - case "enableModelExplainability": - err = unpopulate(val, "EnableModelExplainability", &f.EnableModelExplainability) - delete(rawMsg, key) - case "enableOnnxCompatibleModels": - err = unpopulate(val, "EnableOnnxCompatibleModels", &f.EnableOnnxCompatibleModels) - delete(rawMsg, key) - case "enableStackEnsemble": - err = unpopulate(val, "EnableStackEnsemble", &f.EnableStackEnsemble) - delete(rawMsg, key) - case "enableVoteEnsemble": - err = unpopulate(val, "EnableVoteEnsemble", &f.EnableVoteEnsemble) - delete(rawMsg, key) - case "ensembleModelDownloadTimeout": - err = unpopulate(val, "EnsembleModelDownloadTimeout", &f.EnsembleModelDownloadTimeout) - delete(rawMsg, key) - case "stackEnsembleSettings": - err = unpopulate(val, "StackEnsembleSettings", &f.StackEnsembleSettings) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GridSamplingAlgorithm. -func (g GridSamplingAlgorithm) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnoseResponseResultValue. +func (d DiagnoseResponseResultValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeGrid + populate(objectMap, "applicationInsightsResults", d.ApplicationInsightsResults) + populate(objectMap, "containerRegistryResults", d.ContainerRegistryResults) + populate(objectMap, "dnsResolutionResults", d.DNSResolutionResults) + populate(objectMap, "keyVaultResults", d.KeyVaultResults) + populate(objectMap, "networkSecurityRuleResults", d.NetworkSecurityRuleResults) + populate(objectMap, "otherResults", d.OtherResults) + populate(objectMap, "resourceLockResults", d.ResourceLockResults) + populate(objectMap, "storageAccountResults", d.StorageAccountResults) + populate(objectMap, "userDefinedRouteResults", d.UserDefinedRouteResults) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GridSamplingAlgorithm. -func (g *GridSamplingAlgorithm) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseResponseResultValue. +func (d *DiagnoseResponseResultValue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "samplingAlgorithmType": - err = unpopulate(val, "SamplingAlgorithmType", &g.SamplingAlgorithmType) + case "applicationInsightsResults": + err = unpopulate(val, "ApplicationInsightsResults", &d.ApplicationInsightsResults) + delete(rawMsg, key) + case "containerRegistryResults": + err = unpopulate(val, "ContainerRegistryResults", &d.ContainerRegistryResults) + delete(rawMsg, key) + case "dnsResolutionResults": + err = unpopulate(val, "DNSResolutionResults", &d.DNSResolutionResults) + delete(rawMsg, key) + case "keyVaultResults": + err = unpopulate(val, "KeyVaultResults", &d.KeyVaultResults) + delete(rawMsg, key) + case "networkSecurityRuleResults": + err = unpopulate(val, "NetworkSecurityRuleResults", &d.NetworkSecurityRuleResults) + delete(rawMsg, key) + case "otherResults": + err = unpopulate(val, "OtherResults", &d.OtherResults) + delete(rawMsg, key) + case "resourceLockResults": + err = unpopulate(val, "ResourceLockResults", &d.ResourceLockResults) + delete(rawMsg, key) + case "storageAccountResults": + err = unpopulate(val, "StorageAccountResults", &d.StorageAccountResults) + delete(rawMsg, key) + case "userDefinedRouteResults": + err = unpopulate(val, "UserDefinedRouteResults", &d.UserDefinedRouteResults) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HDInsight. -func (h HDInsight) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnoseResult. +func (d DiagnoseResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", h.ComputeLocation) - objectMap["computeType"] = ComputeTypeHDInsight - populateTimeRFC3339(objectMap, "createdOn", h.CreatedOn) - populate(objectMap, "description", h.Description) - populate(objectMap, "disableLocalAuth", h.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", h.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", h.ModifiedOn) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "provisioningErrors", h.ProvisioningErrors) - populate(objectMap, "provisioningState", h.ProvisioningState) - populate(objectMap, "resourceId", h.ResourceID) + populate(objectMap, "code", d.Code) + populate(objectMap, "level", d.Level) + populate(objectMap, "message", d.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsight. -func (h *HDInsight) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseResult. +func (d *DiagnoseResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &h.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &h.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &h.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &h.Description) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &h.DisableLocalAuth) - delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &h.IsAttachedCompute) - delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &h.ModifiedOn) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) - delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &h.ProvisioningErrors) + case "code": + err = unpopulate(val, "Code", &d.Code) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + case "level": + err = unpopulate(val, "Level", &d.Level) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &h.ResourceID) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HDInsightProperties. -func (h HDInsightProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnoseWorkspaceParameters. +func (d DiagnoseWorkspaceParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", h.Address) - populate(objectMap, "administratorAccount", h.AdministratorAccount) - populate(objectMap, "sshPort", h.SSHPort) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightProperties. -func (h *HDInsightProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseWorkspaceParameters. +func (d *DiagnoseWorkspaceParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &h.Address) - delete(rawMsg, key) - case "administratorAccount": - err = unpopulate(val, "AdministratorAccount", &h.AdministratorAccount) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) - case "sshPort": - err = unpopulate(val, "SSHPort", &h.SSHPort) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributionConfiguration. +func (d DistributionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["distributionType"] = d.DistributionType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributionConfiguration. +func (d *DistributionConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "distributionType": + err = unpopulate(val, "DistributionType", &d.DistributionType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HDInsightSchema. -func (h HDInsightSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Docker. +func (d Docker) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", h.Properties) + populate(objectMap, "privileged", d.Privileged) + if d.AdditionalProperties != nil { + for key, val := range d.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightSchema. -func (h *HDInsightSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Docker. +func (d *Docker) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &h.Properties) + case "privileged": + err = unpopulate(val, "Privileged", &d.Privileged) + delete(rawMsg, key) + default: + if d.AdditionalProperties == nil { + d.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + d.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IDAssetReference. -func (i IDAssetReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DockerCredential. +func (d DockerCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assetId", i.AssetID) - objectMap["referenceType"] = ReferenceTypeID + objectMap["credentialType"] = DataReferenceCredentialTypeDockerCredentials + populate(objectMap, "password", d.Password) + populate(objectMap, "userName", d.UserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IDAssetReference. -func (i *IDAssetReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DockerCredential. +func (d *DockerCredential) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "assetId": - err = unpopulate(val, "AssetID", &i.AssetID) + case "credentialType": + err = unpopulate(val, "CredentialType", &d.CredentialType) delete(rawMsg, key) - case "referenceType": - err = unpopulate(val, "ReferenceType", &i.ReferenceType) + case "password": + err = unpopulate(val, "Password", &d.Password) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &d.UserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityConfiguration. -func (i IdentityConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EarlyTerminationPolicy. +func (e EarlyTerminationPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["identityType"] = i.IdentityType + populate(objectMap, "delayEvaluation", e.DelayEvaluation) + populate(objectMap, "evaluationInterval", e.EvaluationInterval) + objectMap["policyType"] = e.PolicyType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityConfiguration. -func (i *IdentityConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EarlyTerminationPolicy. +func (e *EarlyTerminationPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "identityType": - err = unpopulate(val, "IdentityType", &i.IdentityType) + case "delayEvaluation": + err = unpopulate(val, "DelayEvaluation", &e.DelayEvaluation) + delete(rawMsg, key) + case "evaluationInterval": + err = unpopulate(val, "EvaluationInterval", &e.EvaluationInterval) + delete(rawMsg, key) + case "policyType": + err = unpopulate(val, "PolicyType", &e.PolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityForCmk. -func (i IdentityForCmk) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EncryptionKeyVaultUpdateProperties. +func (e EncryptionKeyVaultUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "userAssignedIdentity", i.UserAssignedIdentity) + populate(objectMap, "keyIdentifier", e.KeyIdentifier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityForCmk. -func (i *IdentityForCmk) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionKeyVaultUpdateProperties. +func (e *EncryptionKeyVaultUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "userAssignedIdentity": - err = unpopulate(val, "UserAssignedIdentity", &i.UserAssignedIdentity) + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &e.KeyIdentifier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageClassification. -func (i ImageClassification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EncryptionProperty. +func (e EncryptionProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "logVerbosity", i.LogVerbosity) - populate(objectMap, "modelSettings", i.ModelSettings) - populate(objectMap, "primaryMetric", i.PrimaryMetric) - populate(objectMap, "searchSpace", i.SearchSpace) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "targetColumnName", i.TargetColumnName) - objectMap["taskType"] = TaskTypeImageClassification - populate(objectMap, "trainingData", i.TrainingData) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + populate(objectMap, "cosmosDbResourceId", e.CosmosDbResourceID) + populate(objectMap, "identity", e.Identity) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + populate(objectMap, "searchAccountResourceId", e.SearchAccountResourceID) + populate(objectMap, "status", e.Status) + populate(objectMap, "storageAccountResourceId", e.StorageAccountResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageClassification. -func (i *ImageClassification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperty. +func (e *EncryptionProperty) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) + case "cosmosDbResourceId": + err = unpopulate(val, "CosmosDbResourceID", &e.CosmosDbResourceID) delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) - delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) - delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) - delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) - delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) - delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &i.TrainingData) + case "searchAccountResourceId": + err = unpopulate(val, "SearchAccountResourceID", &e.SearchAccountResourceID) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "status": + err = unpopulate(val, "Status", &e.Status) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &e.StorageAccountResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageClassificationBase. -func (i ImageClassificationBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EncryptionUpdateProperties. +func (e EncryptionUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "modelSettings", i.ModelSettings) - populate(objectMap, "searchSpace", i.SearchSpace) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageClassificationBase. -func (i *ImageClassificationBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionUpdateProperties. +func (e *EncryptionUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) - delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) - delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) - delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) - delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) - delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageClassificationMultilabel. -func (i ImageClassificationMultilabel) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Endpoint. +func (e Endpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "logVerbosity", i.LogVerbosity) - populate(objectMap, "modelSettings", i.ModelSettings) - populate(objectMap, "primaryMetric", i.PrimaryMetric) - populate(objectMap, "searchSpace", i.SearchSpace) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "targetColumnName", i.TargetColumnName) - objectMap["taskType"] = TaskTypeImageClassificationMultilabel - populate(objectMap, "trainingData", i.TrainingData) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + populate(objectMap, "hostIp", e.HostIP) + populate(objectMap, "name", e.Name) + populate(objectMap, "protocol", e.Protocol) + populate(objectMap, "published", e.Published) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageClassificationMultilabel. -func (i *ImageClassificationMultilabel) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Endpoint. +func (e *Endpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) - delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) - delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) - delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + case "hostIp": + err = unpopulate(val, "HostIP", &e.HostIP) delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) - delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) - delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &i.TrainingData) + case "protocol": + err = unpopulate(val, "Protocol", &e.Protocol) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "published": + err = unpopulate(val, "Published", &e.Published) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageInstanceSegmentation. -func (i ImageInstanceSegmentation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EndpointAuthKeys. +func (e EndpointAuthKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "logVerbosity", i.LogVerbosity) - populate(objectMap, "modelSettings", i.ModelSettings) - populate(objectMap, "primaryMetric", i.PrimaryMetric) - populate(objectMap, "searchSpace", i.SearchSpace) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "targetColumnName", i.TargetColumnName) - objectMap["taskType"] = TaskTypeImageInstanceSegmentation - populate(objectMap, "trainingData", i.TrainingData) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + populate(objectMap, "primaryKey", e.PrimaryKey) + populate(objectMap, "secondaryKey", e.SecondaryKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageInstanceSegmentation. -func (i *ImageInstanceSegmentation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointAuthKeys. +func (e *EndpointAuthKeys) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) - delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) - delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) - delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) - delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) - delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) - delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) - delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &i.TrainingData) - delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &e.PrimaryKey) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &e.SecondaryKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageLimitSettings. -func (i ImageLimitSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EndpointAuthToken. +func (e EndpointAuthToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxConcurrentTrials", i.MaxConcurrentTrials) - populate(objectMap, "maxTrials", i.MaxTrials) - populate(objectMap, "timeout", i.Timeout) + populate(objectMap, "accessToken", e.AccessToken) + populate(objectMap, "expiryTimeUtc", e.ExpiryTimeUTC) + populate(objectMap, "refreshAfterTimeUtc", e.RefreshAfterTimeUTC) + populate(objectMap, "tokenType", e.TokenType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageLimitSettings. -func (i *ImageLimitSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointAuthToken. +func (e *EndpointAuthToken) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "maxConcurrentTrials": - err = unpopulate(val, "MaxConcurrentTrials", &i.MaxConcurrentTrials) + case "accessToken": + err = unpopulate(val, "AccessToken", &e.AccessToken) delete(rawMsg, key) - case "maxTrials": - err = unpopulate(val, "MaxTrials", &i.MaxTrials) + case "expiryTimeUtc": + err = unpopulate(val, "ExpiryTimeUTC", &e.ExpiryTimeUTC) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &i.Timeout) + case "refreshAfterTimeUtc": + err = unpopulate(val, "RefreshAfterTimeUTC", &e.RefreshAfterTimeUTC) + delete(rawMsg, key) + case "tokenType": + err = unpopulate(val, "TokenType", &e.TokenType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageModelDistributionSettings. -func (i ImageModelDistributionSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EndpointDeploymentPropertiesBase. +func (e EndpointDeploymentPropertiesBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "amsGradient", i.AmsGradient) - populate(objectMap, "augmentations", i.Augmentations) - populate(objectMap, "beta1", i.Beta1) - populate(objectMap, "beta2", i.Beta2) - populate(objectMap, "distributed", i.Distributed) - populate(objectMap, "earlyStopping", i.EarlyStopping) - populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) - populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) - populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) - populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) - populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) - populate(objectMap, "layersToFreeze", i.LayersToFreeze) - populate(objectMap, "learningRate", i.LearningRate) - populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) - populate(objectMap, "modelName", i.ModelName) - populate(objectMap, "momentum", i.Momentum) - populate(objectMap, "nesterov", i.Nesterov) - populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) - populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) - populate(objectMap, "optimizer", i.Optimizer) - populate(objectMap, "randomSeed", i.RandomSeed) - populate(objectMap, "stepLRGamma", i.StepLRGamma) - populate(objectMap, "stepLRStepSize", i.StepLRStepSize) - populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) - populate(objectMap, "validationBatchSize", i.ValidationBatchSize) - populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) - populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) - populate(objectMap, "weightDecay", i.WeightDecay) + populate(objectMap, "codeConfiguration", e.CodeConfiguration) + populate(objectMap, "description", e.Description) + populate(objectMap, "environmentId", e.EnvironmentID) + populate(objectMap, "environmentVariables", e.EnvironmentVariables) + populate(objectMap, "properties", e.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelDistributionSettings. -func (i *ImageModelDistributionSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDeploymentPropertiesBase. +func (e *EndpointDeploymentPropertiesBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) - delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) - delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) - delete(rawMsg, key) - case "beta2": - err = unpopulate(val, "Beta2", &i.Beta2) - delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) - delete(rawMsg, key) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) - delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) - delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) - delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) - delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) - delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &e.CodeConfiguration) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &e.EnvironmentID) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &e.EnvironmentVariables) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesBase. +func (e EndpointPropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authMode", e.AuthMode) + populate(objectMap, "description", e.Description) + populate(objectMap, "keys", e.Keys) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "scoringUri", e.ScoringURI) + populate(objectMap, "swaggerUri", e.SwaggerURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesBase. +func (e *EndpointPropertiesBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authMode": + err = unpopulate(val, "AuthMode", &e.AuthMode) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "keys": + err = unpopulate(val, "Keys", &e.Keys) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "scoringUri": + err = unpopulate(val, "ScoringURI", &e.ScoringURI) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "swaggerUri": + err = unpopulate(val, "SwaggerURI", &e.SwaggerURI) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointScheduleAction. +func (e EndpointScheduleAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["actionType"] = ScheduleActionTypeInvokeBatchEndpoint + populateAny(objectMap, "endpointInvocationDefinition", e.EndpointInvocationDefinition) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointScheduleAction. +func (e *EndpointScheduleAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &e.ActionType) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "endpointInvocationDefinition": + err = unpopulate(val, "EndpointInvocationDefinition", &e.EndpointInvocationDefinition) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainer. +func (e EnvironmentContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentContainer. +func (e *EnvironmentContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageModelDistributionSettingsClassification. -func (i ImageModelDistributionSettingsClassification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainerProperties. +func (e EnvironmentContainerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "amsGradient", i.AmsGradient) - populate(objectMap, "augmentations", i.Augmentations) - populate(objectMap, "beta1", i.Beta1) - populate(objectMap, "beta2", i.Beta2) - populate(objectMap, "distributed", i.Distributed) - populate(objectMap, "earlyStopping", i.EarlyStopping) - populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) - populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) - populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) - populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) - populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) - populate(objectMap, "layersToFreeze", i.LayersToFreeze) - populate(objectMap, "learningRate", i.LearningRate) - populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) - populate(objectMap, "modelName", i.ModelName) - populate(objectMap, "momentum", i.Momentum) - populate(objectMap, "nesterov", i.Nesterov) - populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) - populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) - populate(objectMap, "optimizer", i.Optimizer) - populate(objectMap, "randomSeed", i.RandomSeed) - populate(objectMap, "stepLRGamma", i.StepLRGamma) - populate(objectMap, "stepLRStepSize", i.StepLRStepSize) - populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) - populate(objectMap, "trainingCropSize", i.TrainingCropSize) - populate(objectMap, "validationBatchSize", i.ValidationBatchSize) - populate(objectMap, "validationCropSize", i.ValidationCropSize) - populate(objectMap, "validationResizeSize", i.ValidationResizeSize) - populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) - populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) - populate(objectMap, "weightDecay", i.WeightDecay) - populate(objectMap, "weightedLoss", i.WeightedLoss) + populate(objectMap, "description", e.Description) + populate(objectMap, "isArchived", e.IsArchived) + populate(objectMap, "latestVersion", e.LatestVersion) + populate(objectMap, "nextVersion", e.NextVersion) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "tags", e.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelDistributionSettingsClassification. -func (i *ImageModelDistributionSettingsClassification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentContainerProperties. +func (e *EnvironmentContainerProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) + case "isArchived": + err = unpopulate(val, "IsArchived", &e.IsArchived) delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &e.LatestVersion) delete(rawMsg, key) - case "beta2": - err = unpopulate(val, "Beta2", &i.Beta2) + case "nextVersion": + err = unpopulate(val, "NextVersion", &e.NextVersion) delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) - delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) - delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) - delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) - delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) - delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) - delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) - delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) - delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) - delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) - delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) - delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) - delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) - delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) - delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) - delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentContainerResourceArmPaginatedResult. +func (e EnvironmentContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentContainerResourceArmPaginatedResult. +func (e *EnvironmentContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) - case "trainingCropSize": - err = unpopulate(val, "TrainingCropSize", &i.TrainingCropSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVariable. +func (e EnvironmentVariable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", e.Type) + populate(objectMap, "value", e.Value) + if e.AdditionalProperties != nil { + for key, val := range e.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVariable. +func (e *EnvironmentVariable) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) - case "validationCropSize": - err = unpopulate(val, "ValidationCropSize", &i.ValidationCropSize) + default: + if e.AdditionalProperties == nil { + e.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + e.AdditionalProperties[key] = aux + } delete(rawMsg, key) - case "validationResizeSize": - err = unpopulate(val, "ValidationResizeSize", &i.ValidationResizeSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersion. +func (e EnvironmentVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVersion. +func (e *EnvironmentVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) - case "weightedLoss": - err = unpopulate(val, "WeightedLoss", &i.WeightedLoss) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageModelDistributionSettingsObjectDetection. -func (i ImageModelDistributionSettingsObjectDetection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersionProperties. +func (e EnvironmentVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "amsGradient", i.AmsGradient) - populate(objectMap, "augmentations", i.Augmentations) - populate(objectMap, "beta1", i.Beta1) - populate(objectMap, "beta2", i.Beta2) - populate(objectMap, "boxDetectionsPerImage", i.BoxDetectionsPerImage) - populate(objectMap, "boxScoreThreshold", i.BoxScoreThreshold) - populate(objectMap, "distributed", i.Distributed) - populate(objectMap, "earlyStopping", i.EarlyStopping) - populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) - populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) - populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) - populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) - populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) - populate(objectMap, "imageSize", i.ImageSize) - populate(objectMap, "layersToFreeze", i.LayersToFreeze) - populate(objectMap, "learningRate", i.LearningRate) - populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) - populate(objectMap, "maxSize", i.MaxSize) - populate(objectMap, "minSize", i.MinSize) - populate(objectMap, "modelName", i.ModelName) - populate(objectMap, "modelSize", i.ModelSize) - populate(objectMap, "momentum", i.Momentum) - populate(objectMap, "multiScale", i.MultiScale) - populate(objectMap, "nesterov", i.Nesterov) - populate(objectMap, "nmsIouThreshold", i.NmsIouThreshold) - populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) - populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) - populate(objectMap, "optimizer", i.Optimizer) - populate(objectMap, "randomSeed", i.RandomSeed) - populate(objectMap, "stepLRGamma", i.StepLRGamma) - populate(objectMap, "stepLRStepSize", i.StepLRStepSize) - populate(objectMap, "tileGridSize", i.TileGridSize) - populate(objectMap, "tileOverlapRatio", i.TileOverlapRatio) - populate(objectMap, "tilePredictionsNmsThreshold", i.TilePredictionsNmsThreshold) - populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) - populate(objectMap, "validationBatchSize", i.ValidationBatchSize) - populate(objectMap, "validationIouThreshold", i.ValidationIouThreshold) - populate(objectMap, "validationMetricType", i.ValidationMetricType) - populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) - populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) - populate(objectMap, "weightDecay", i.WeightDecay) + populate(objectMap, "autoDeleteSetting", e.AutoDeleteSetting) + populate(objectMap, "autoRebuild", e.AutoRebuild) + populate(objectMap, "build", e.Build) + populate(objectMap, "condaFile", e.CondaFile) + populate(objectMap, "description", e.Description) + populate(objectMap, "environmentType", e.EnvironmentType) + populate(objectMap, "image", e.Image) + populate(objectMap, "inferenceConfig", e.InferenceConfig) + populate(objectMap, "intellectualProperty", e.IntellectualProperty) + populate(objectMap, "isAnonymous", e.IsAnonymous) + populate(objectMap, "isArchived", e.IsArchived) + populate(objectMap, "osType", e.OSType) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "stage", e.Stage) + populate(objectMap, "tags", e.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelDistributionSettingsObjectDetection. -func (i *ImageModelDistributionSettingsObjectDetection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVersionProperties. +func (e *EnvironmentVersionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &e.AutoDeleteSetting) delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) + case "autoRebuild": + err = unpopulate(val, "AutoRebuild", &e.AutoRebuild) delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) + case "build": + err = unpopulate(val, "Build", &e.Build) delete(rawMsg, key) - case "beta2": - err = unpopulate(val, "Beta2", &i.Beta2) + case "condaFile": + err = unpopulate(val, "CondaFile", &e.CondaFile) delete(rawMsg, key) - case "boxDetectionsPerImage": - err = unpopulate(val, "BoxDetectionsPerImage", &i.BoxDetectionsPerImage) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "boxScoreThreshold": - err = unpopulate(val, "BoxScoreThreshold", &i.BoxScoreThreshold) + case "environmentType": + err = unpopulate(val, "EnvironmentType", &e.EnvironmentType) delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) + case "image": + err = unpopulate(val, "Image", &e.Image) + delete(rawMsg, key) + case "inferenceConfig": + err = unpopulate(val, "InferenceConfig", &e.InferenceConfig) + delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &e.IntellectualProperty) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &e.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &e.IsArchived) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &e.OSType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &e.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVersionResourceArmPaginatedResult. +func (e EnvironmentVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVersionResourceArmPaginatedResult. +func (e *EnvironmentVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EstimatedVMPrice. +func (e EstimatedVMPrice) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "osType", e.OSType) + populate(objectMap, "retailPrice", e.RetailPrice) + populate(objectMap, "vmTier", e.VMTier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EstimatedVMPrice. +func (e *EstimatedVMPrice) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "osType": + err = unpopulate(val, "OSType", &e.OSType) + delete(rawMsg, key) + case "retailPrice": + err = unpopulate(val, "RetailPrice", &e.RetailPrice) + delete(rawMsg, key) + case "vmTier": + err = unpopulate(val, "VMTier", &e.VMTier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EstimatedVMPrices. +func (e EstimatedVMPrices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "billingCurrency", e.BillingCurrency) + populate(objectMap, "unitOfMeasure", e.UnitOfMeasure) + populate(objectMap, "values", e.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EstimatedVMPrices. +func (e *EstimatedVMPrices) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "billingCurrency": + err = unpopulate(val, "BillingCurrency", &e.BillingCurrency) + delete(rawMsg, key) + case "unitOfMeasure": + err = unpopulate(val, "UnitOfMeasure", &e.UnitOfMeasure) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &e.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExportSummary. +func (e ExportSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endDateTime", e.EndDateTime) + populate(objectMap, "exportedRowCount", e.ExportedRowCount) + objectMap["format"] = e.Format + populate(objectMap, "labelingJobId", e.LabelingJobID) + populateDateTimeRFC3339(objectMap, "startDateTime", e.StartDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportSummary. +func (e *ExportSummary) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endDateTime": + err = unpopulateDateTimeRFC3339(val, "EndDateTime", &e.EndDateTime) + delete(rawMsg, key) + case "exportedRowCount": + err = unpopulate(val, "ExportedRowCount", &e.ExportedRowCount) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &e.Format) + delete(rawMsg, key) + case "labelingJobId": + err = unpopulate(val, "LabelingJobID", &e.LabelingJobID) + delete(rawMsg, key) + case "startDateTime": + err = unpopulateDateTimeRFC3339(val, "StartDateTime", &e.StartDateTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExternalFQDNResponse. +func (e ExternalFQDNResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalFQDNResponse. +func (e *ExternalFQDNResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FQDNEndpoint. +func (f FQDNEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainName", f.DomainName) + populate(objectMap, "endpointDetails", f.EndpointDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpoint. +func (f *FQDNEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainName": + err = unpopulate(val, "DomainName", &f.DomainName) + delete(rawMsg, key) + case "endpointDetails": + err = unpopulate(val, "EndpointDetails", &f.EndpointDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FQDNEndpointDetail. +func (f FQDNEndpointDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", f.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpointDetail. +func (f *FQDNEndpointDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &f.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FQDNEndpoints. +func (f FQDNEndpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "category", f.Category) + populate(objectMap, "endpoints", f.Endpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpoints. +func (f *FQDNEndpoints) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &f.Category) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &f.Endpoints) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FQDNEndpointsPropertyBag. +func (f FQDNEndpointsPropertyBag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FQDNEndpointsPropertyBag. +func (f *FQDNEndpointsPropertyBag) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Feature. +func (f Feature) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Feature. +func (f *Feature) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureAttributionDriftMonitoringSignal. +func (f FeatureAttributionDriftMonitoringSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "featureDataTypeOverride", f.FeatureDataTypeOverride) + populate(objectMap, "featureImportanceSettings", f.FeatureImportanceSettings) + populate(objectMap, "metricThreshold", f.MetricThreshold) + populate(objectMap, "notificationTypes", f.NotificationTypes) + populate(objectMap, "productionData", f.ProductionData) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "referenceData", f.ReferenceData) + objectMap["signalType"] = MonitoringSignalTypeFeatureAttributionDrift + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureAttributionDriftMonitoringSignal. +func (f *FeatureAttributionDriftMonitoringSignal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "featureDataTypeOverride": + err = unpopulate(val, "FeatureDataTypeOverride", &f.FeatureDataTypeOverride) + delete(rawMsg, key) + case "featureImportanceSettings": + err = unpopulate(val, "FeatureImportanceSettings", &f.FeatureImportanceSettings) + delete(rawMsg, key) + case "metricThreshold": + err = unpopulate(val, "MetricThreshold", &f.MetricThreshold) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &f.NotificationTypes) + delete(rawMsg, key) + case "productionData": + f.ProductionData, err = unmarshalMonitoringInputDataBaseClassificationArray(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "referenceData": + f.ReferenceData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &f.SignalType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureAttributionMetricThreshold. +func (f FeatureAttributionMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metric", f.Metric) + populate(objectMap, "threshold", f.Threshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureAttributionMetricThreshold. +func (f *FeatureAttributionMetricThreshold) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metric": + err = unpopulate(val, "Metric", &f.Metric) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &f.Threshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureImportanceSettings. +func (f FeatureImportanceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mode", f.Mode) + populate(objectMap, "targetColumn", f.TargetColumn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureImportanceSettings. +func (f *FeatureImportanceSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mode": + err = unpopulate(val, "Mode", &f.Mode) + delete(rawMsg, key) + case "targetColumn": + err = unpopulate(val, "TargetColumn", &f.TargetColumn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureProperties. +func (f FeatureProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataType", f.DataType) + populate(objectMap, "description", f.Description) + populate(objectMap, "featureName", f.FeatureName) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureProperties. +func (f *FeatureProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &f.DataType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "featureName": + err = unpopulate(val, "FeatureName", &f.FeatureName) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureResourceArmPaginatedResult. +func (f FeatureResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureResourceArmPaginatedResult. +func (f *FeatureResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureStoreSettings. +func (f FeatureStoreSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeRuntime", f.ComputeRuntime) + populate(objectMap, "offlineStoreConnectionName", f.OfflineStoreConnectionName) + populate(objectMap, "onlineStoreConnectionName", f.OnlineStoreConnectionName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureStoreSettings. +func (f *FeatureStoreSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeRuntime": + err = unpopulate(val, "ComputeRuntime", &f.ComputeRuntime) + delete(rawMsg, key) + case "offlineStoreConnectionName": + err = unpopulate(val, "OfflineStoreConnectionName", &f.OfflineStoreConnectionName) + delete(rawMsg, key) + case "onlineStoreConnectionName": + err = unpopulate(val, "OnlineStoreConnectionName", &f.OnlineStoreConnectionName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureSubset. +func (f FeatureSubset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "features", f.Features) + objectMap["filterType"] = MonitoringFeatureFilterTypeFeatureSubset + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureSubset. +func (f *FeatureSubset) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "features": + err = unpopulate(val, "Features", &f.Features) + delete(rawMsg, key) + case "filterType": + err = unpopulate(val, "FilterType", &f.FilterType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeatureWindow. +func (f FeatureWindow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "featureWindowEnd", f.FeatureWindowEnd) + populateDateTimeRFC3339(objectMap, "featureWindowStart", f.FeatureWindowStart) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureWindow. +func (f *FeatureWindow) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "featureWindowEnd": + err = unpopulateDateTimeRFC3339(val, "FeatureWindowEnd", &f.FeatureWindowEnd) + delete(rawMsg, key) + case "featureWindowStart": + err = unpopulateDateTimeRFC3339(val, "FeatureWindowStart", &f.FeatureWindowStart) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetContainer. +func (f FeaturesetContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetContainer. +func (f *FeaturesetContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetContainerProperties. +func (f FeaturesetContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", f.Description) + populate(objectMap, "isArchived", f.IsArchived) + populate(objectMap, "latestVersion", f.LatestVersion) + populate(objectMap, "nextVersion", f.NextVersion) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetContainerProperties. +func (f *FeaturesetContainerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) + delete(rawMsg, key) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &f.LatestVersion) + delete(rawMsg, key) + case "nextVersion": + err = unpopulate(val, "NextVersion", &f.NextVersion) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetContainerResourceArmPaginatedResult. +func (f FeaturesetContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetContainerResourceArmPaginatedResult. +func (f *FeaturesetContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetSpecification. +func (f FeaturesetSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "path", f.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetSpecification. +func (f *FeaturesetSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "path": + err = unpopulate(val, "Path", &f.Path) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetVersion. +func (f FeaturesetVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetVersion. +func (f *FeaturesetVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetVersionBackfillRequest. +func (f FeaturesetVersionBackfillRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataAvailabilityStatus", f.DataAvailabilityStatus) + populate(objectMap, "description", f.Description) + populate(objectMap, "displayName", f.DisplayName) + populate(objectMap, "featureWindow", f.FeatureWindow) + populate(objectMap, "jobId", f.JobID) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "resource", f.Resource) + populate(objectMap, "sparkConfiguration", f.SparkConfiguration) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetVersionBackfillRequest. +func (f *FeaturesetVersionBackfillRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataAvailabilityStatus": + err = unpopulate(val, "DataAvailabilityStatus", &f.DataAvailabilityStatus) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) + delete(rawMsg, key) + case "featureWindow": + err = unpopulate(val, "FeatureWindow", &f.FeatureWindow) + delete(rawMsg, key) + case "jobId": + err = unpopulate(val, "JobID", &f.JobID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &f.Resource) + delete(rawMsg, key) + case "sparkConfiguration": + err = unpopulate(val, "SparkConfiguration", &f.SparkConfiguration) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetVersionBackfillResponse. +func (f FeaturesetVersionBackfillResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "jobIds", f.JobIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetVersionBackfillResponse. +func (f *FeaturesetVersionBackfillResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "jobIds": + err = unpopulate(val, "JobIDs", &f.JobIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetVersionProperties. +func (f FeaturesetVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", f.AutoDeleteSetting) + populate(objectMap, "description", f.Description) + populate(objectMap, "entities", f.Entities) + populate(objectMap, "isAnonymous", f.IsAnonymous) + populate(objectMap, "isArchived", f.IsArchived) + populate(objectMap, "materializationSettings", f.MaterializationSettings) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "specification", f.Specification) + populate(objectMap, "stage", f.Stage) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetVersionProperties. +func (f *FeaturesetVersionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &f.AutoDeleteSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "entities": + err = unpopulate(val, "Entities", &f.Entities) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &f.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) + delete(rawMsg, key) + case "materializationSettings": + err = unpopulate(val, "MaterializationSettings", &f.MaterializationSettings) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "specification": + err = unpopulate(val, "Specification", &f.Specification) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &f.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturesetVersionResourceArmPaginatedResult. +func (f FeaturesetVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturesetVersionResourceArmPaginatedResult. +func (f *FeaturesetVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturestoreEntityContainer. +func (f FeaturestoreEntityContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturestoreEntityContainer. +func (f *FeaturestoreEntityContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturestoreEntityContainerProperties. +func (f FeaturestoreEntityContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", f.Description) + populate(objectMap, "isArchived", f.IsArchived) + populate(objectMap, "latestVersion", f.LatestVersion) + populate(objectMap, "nextVersion", f.NextVersion) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturestoreEntityContainerProperties. +func (f *FeaturestoreEntityContainerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) + delete(rawMsg, key) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &f.LatestVersion) + delete(rawMsg, key) + case "nextVersion": + err = unpopulate(val, "NextVersion", &f.NextVersion) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturestoreEntityContainerResourceArmPaginatedResult. +func (f FeaturestoreEntityContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturestoreEntityContainerResourceArmPaginatedResult. +func (f *FeaturestoreEntityContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturestoreEntityVersion. +func (f FeaturestoreEntityVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturestoreEntityVersion. +func (f *FeaturestoreEntityVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturestoreEntityVersionProperties. +func (f FeaturestoreEntityVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", f.AutoDeleteSetting) + populate(objectMap, "description", f.Description) + populate(objectMap, "indexColumns", f.IndexColumns) + populate(objectMap, "isAnonymous", f.IsAnonymous) + populate(objectMap, "isArchived", f.IsArchived) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "provisioningState", f.ProvisioningState) + populate(objectMap, "stage", f.Stage) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturestoreEntityVersionProperties. +func (f *FeaturestoreEntityVersionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &f.AutoDeleteSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "indexColumns": + err = unpopulate(val, "IndexColumns", &f.IndexColumns) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &f.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &f.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturestoreEntityVersionResourceArmPaginatedResult. +func (f FeaturestoreEntityVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturestoreEntityVersionResourceArmPaginatedResult. +func (f *FeaturestoreEntityVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FeaturizationSettings. +func (f FeaturizationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "datasetLanguage", f.DatasetLanguage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeaturizationSettings. +func (f *FeaturizationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "datasetLanguage": + err = unpopulate(val, "DatasetLanguage", &f.DatasetLanguage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileSystemSource. +func (f FileSystemSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connection", f.Connection) + populate(objectMap, "path", f.Path) + objectMap["sourceType"] = DataImportSourceTypeFileSystem + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileSystemSource. +func (f *FileSystemSource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connection": + err = unpopulate(val, "Connection", &f.Connection) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &f.Path) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &f.SourceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FixedInputData. +func (f FixedInputData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columns", f.Columns) + populate(objectMap, "dataContext", f.DataContext) + objectMap["inputDataType"] = MonitoringInputDataTypeFixed + populate(objectMap, "jobInputType", f.JobInputType) + populate(objectMap, "uri", f.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FixedInputData. +func (f *FixedInputData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columns": + err = unpopulate(val, "Columns", &f.Columns) + delete(rawMsg, key) + case "dataContext": + err = unpopulate(val, "DataContext", &f.DataContext) + delete(rawMsg, key) + case "inputDataType": + err = unpopulate(val, "InputDataType", &f.InputDataType) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &f.JobInputType) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &f.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FlavorData. +func (f FlavorData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", f.Data) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FlavorData. +func (f *FlavorData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &f.Data) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForecastHorizon. +func (f ForecastHorizon) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["mode"] = f.Mode + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForecastHorizon. +func (f *ForecastHorizon) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mode": + err = unpopulate(val, "Mode", &f.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Forecasting. +func (f Forecasting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cvSplitColumnNames", f.CvSplitColumnNames) + populate(objectMap, "featurizationSettings", f.FeaturizationSettings) + populate(objectMap, "fixedParameters", f.FixedParameters) + populate(objectMap, "forecastingSettings", f.ForecastingSettings) + populate(objectMap, "limitSettings", f.LimitSettings) + populate(objectMap, "logVerbosity", f.LogVerbosity) + populate(objectMap, "nCrossValidations", f.NCrossValidations) + populate(objectMap, "primaryMetric", f.PrimaryMetric) + populate(objectMap, "searchSpace", f.SearchSpace) + populate(objectMap, "sweepSettings", f.SweepSettings) + populate(objectMap, "targetColumnName", f.TargetColumnName) + objectMap["taskType"] = TaskTypeForecasting + populate(objectMap, "testData", f.TestData) + populate(objectMap, "testDataSize", f.TestDataSize) + populate(objectMap, "trainingData", f.TrainingData) + populate(objectMap, "trainingSettings", f.TrainingSettings) + populate(objectMap, "validationData", f.ValidationData) + populate(objectMap, "validationDataSize", f.ValidationDataSize) + populate(objectMap, "weightColumnName", f.WeightColumnName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Forecasting. +func (f *Forecasting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cvSplitColumnNames": + err = unpopulate(val, "CvSplitColumnNames", &f.CvSplitColumnNames) + delete(rawMsg, key) + case "featurizationSettings": + err = unpopulate(val, "FeaturizationSettings", &f.FeaturizationSettings) + delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &f.FixedParameters) + delete(rawMsg, key) + case "forecastingSettings": + err = unpopulate(val, "ForecastingSettings", &f.ForecastingSettings) + delete(rawMsg, key) + case "limitSettings": + err = unpopulate(val, "LimitSettings", &f.LimitSettings) + delete(rawMsg, key) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &f.LogVerbosity) + delete(rawMsg, key) + case "nCrossValidations": + f.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &f.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &f.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &f.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &f.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &f.TaskType) + delete(rawMsg, key) + case "testData": + err = unpopulate(val, "TestData", &f.TestData) + delete(rawMsg, key) + case "testDataSize": + err = unpopulate(val, "TestDataSize", &f.TestDataSize) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &f.TrainingData) + delete(rawMsg, key) + case "trainingSettings": + err = unpopulate(val, "TrainingSettings", &f.TrainingSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &f.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &f.ValidationDataSize) + delete(rawMsg, key) + case "weightColumnName": + err = unpopulate(val, "WeightColumnName", &f.WeightColumnName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForecastingSettings. +func (f ForecastingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "countryOrRegionForHolidays", f.CountryOrRegionForHolidays) + populate(objectMap, "cvStepSize", f.CvStepSize) + populate(objectMap, "featureLags", f.FeatureLags) + populate(objectMap, "featuresUnknownAtForecastTime", f.FeaturesUnknownAtForecastTime) + populate(objectMap, "forecastHorizon", f.ForecastHorizon) + populate(objectMap, "frequency", f.Frequency) + populate(objectMap, "seasonality", f.Seasonality) + populate(objectMap, "shortSeriesHandlingConfig", f.ShortSeriesHandlingConfig) + populate(objectMap, "targetAggregateFunction", f.TargetAggregateFunction) + populate(objectMap, "targetLags", f.TargetLags) + populate(objectMap, "targetRollingWindowSize", f.TargetRollingWindowSize) + populate(objectMap, "timeColumnName", f.TimeColumnName) + populate(objectMap, "timeSeriesIdColumnNames", f.TimeSeriesIDColumnNames) + populate(objectMap, "useStl", f.UseStl) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForecastingSettings. +func (f *ForecastingSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "countryOrRegionForHolidays": + err = unpopulate(val, "CountryOrRegionForHolidays", &f.CountryOrRegionForHolidays) + delete(rawMsg, key) + case "cvStepSize": + err = unpopulate(val, "CvStepSize", &f.CvStepSize) + delete(rawMsg, key) + case "featureLags": + err = unpopulate(val, "FeatureLags", &f.FeatureLags) + delete(rawMsg, key) + case "featuresUnknownAtForecastTime": + err = unpopulate(val, "FeaturesUnknownAtForecastTime", &f.FeaturesUnknownAtForecastTime) + delete(rawMsg, key) + case "forecastHorizon": + f.ForecastHorizon, err = unmarshalForecastHorizonClassification(val) + delete(rawMsg, key) + case "frequency": + err = unpopulate(val, "Frequency", &f.Frequency) + delete(rawMsg, key) + case "seasonality": + f.Seasonality, err = unmarshalSeasonalityClassification(val) + delete(rawMsg, key) + case "shortSeriesHandlingConfig": + err = unpopulate(val, "ShortSeriesHandlingConfig", &f.ShortSeriesHandlingConfig) + delete(rawMsg, key) + case "targetAggregateFunction": + err = unpopulate(val, "TargetAggregateFunction", &f.TargetAggregateFunction) + delete(rawMsg, key) + case "targetLags": + f.TargetLags, err = unmarshalTargetLagsClassification(val) + delete(rawMsg, key) + case "targetRollingWindowSize": + f.TargetRollingWindowSize, err = unmarshalTargetRollingWindowSizeClassification(val) + delete(rawMsg, key) + case "timeColumnName": + err = unpopulate(val, "TimeColumnName", &f.TimeColumnName) + delete(rawMsg, key) + case "timeSeriesIdColumnNames": + err = unpopulate(val, "TimeSeriesIDColumnNames", &f.TimeSeriesIDColumnNames) + delete(rawMsg, key) + case "useStl": + err = unpopulate(val, "UseStl", &f.UseStl) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ForecastingTrainingSettings. +func (f ForecastingTrainingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedTrainingAlgorithms", f.AllowedTrainingAlgorithms) + populate(objectMap, "blockedTrainingAlgorithms", f.BlockedTrainingAlgorithms) + populate(objectMap, "enableDnnTraining", f.EnableDnnTraining) + populate(objectMap, "enableModelExplainability", f.EnableModelExplainability) + populate(objectMap, "enableOnnxCompatibleModels", f.EnableOnnxCompatibleModels) + populate(objectMap, "enableStackEnsemble", f.EnableStackEnsemble) + populate(objectMap, "enableVoteEnsemble", f.EnableVoteEnsemble) + populate(objectMap, "ensembleModelDownloadTimeout", f.EnsembleModelDownloadTimeout) + populate(objectMap, "stackEnsembleSettings", f.StackEnsembleSettings) + populate(objectMap, "trainingMode", f.TrainingMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ForecastingTrainingSettings. +func (f *ForecastingTrainingSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedTrainingAlgorithms": + err = unpopulate(val, "AllowedTrainingAlgorithms", &f.AllowedTrainingAlgorithms) + delete(rawMsg, key) + case "blockedTrainingAlgorithms": + err = unpopulate(val, "BlockedTrainingAlgorithms", &f.BlockedTrainingAlgorithms) + delete(rawMsg, key) + case "enableDnnTraining": + err = unpopulate(val, "EnableDnnTraining", &f.EnableDnnTraining) + delete(rawMsg, key) + case "enableModelExplainability": + err = unpopulate(val, "EnableModelExplainability", &f.EnableModelExplainability) + delete(rawMsg, key) + case "enableOnnxCompatibleModels": + err = unpopulate(val, "EnableOnnxCompatibleModels", &f.EnableOnnxCompatibleModels) + delete(rawMsg, key) + case "enableStackEnsemble": + err = unpopulate(val, "EnableStackEnsemble", &f.EnableStackEnsemble) + delete(rawMsg, key) + case "enableVoteEnsemble": + err = unpopulate(val, "EnableVoteEnsemble", &f.EnableVoteEnsemble) + delete(rawMsg, key) + case "ensembleModelDownloadTimeout": + err = unpopulate(val, "EnsembleModelDownloadTimeout", &f.EnsembleModelDownloadTimeout) + delete(rawMsg, key) + case "stackEnsembleSettings": + err = unpopulate(val, "StackEnsembleSettings", &f.StackEnsembleSettings) + delete(rawMsg, key) + case "trainingMode": + err = unpopulate(val, "TrainingMode", &f.TrainingMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FqdnOutboundRule. +func (f FqdnOutboundRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "category", f.Category) + populate(objectMap, "destination", f.Destination) + populate(objectMap, "status", f.Status) + objectMap["type"] = RuleTypeFQDN + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FqdnOutboundRule. +func (f *FqdnOutboundRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &f.Category) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &f.Destination) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerationSafetyQualityMetricThreshold. +func (g GenerationSafetyQualityMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metric", g.Metric) + populate(objectMap, "threshold", g.Threshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerationSafetyQualityMetricThreshold. +func (g *GenerationSafetyQualityMetricThreshold) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metric": + err = unpopulate(val, "Metric", &g.Metric) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &g.Threshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerationSafetyQualityMonitoringSignal. +func (g GenerationSafetyQualityMonitoringSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metricThresholds", g.MetricThresholds) + populate(objectMap, "notificationTypes", g.NotificationTypes) + populate(objectMap, "productionData", g.ProductionData) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "samplingRate", g.SamplingRate) + objectMap["signalType"] = MonitoringSignalTypeGenerationSafetyQuality + populate(objectMap, "workspaceConnectionId", g.WorkspaceConnectionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerationSafetyQualityMonitoringSignal. +func (g *GenerationSafetyQualityMonitoringSignal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricThresholds": + err = unpopulate(val, "MetricThresholds", &g.MetricThresholds) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &g.NotificationTypes) + delete(rawMsg, key) + case "productionData": + g.ProductionData, err = unmarshalMonitoringInputDataBaseClassificationArray(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "samplingRate": + err = unpopulate(val, "SamplingRate", &g.SamplingRate) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &g.SignalType) + delete(rawMsg, key) + case "workspaceConnectionId": + err = unpopulate(val, "WorkspaceConnectionID", &g.WorkspaceConnectionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerationTokenUsageMetricThreshold. +func (g GenerationTokenUsageMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metric", g.Metric) + populate(objectMap, "threshold", g.Threshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerationTokenUsageMetricThreshold. +func (g *GenerationTokenUsageMetricThreshold) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metric": + err = unpopulate(val, "Metric", &g.Metric) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &g.Threshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerationTokenUsageSignal. +func (g GenerationTokenUsageSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metricThresholds", g.MetricThresholds) + populate(objectMap, "notificationTypes", g.NotificationTypes) + populate(objectMap, "productionData", g.ProductionData) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "samplingRate", g.SamplingRate) + objectMap["signalType"] = MonitoringSignalTypeGenerationTokenStatistics + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerationTokenUsageSignal. +func (g *GenerationTokenUsageSignal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricThresholds": + err = unpopulate(val, "MetricThresholds", &g.MetricThresholds) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &g.NotificationTypes) + delete(rawMsg, key) + case "productionData": + g.ProductionData, err = unmarshalMonitoringInputDataBaseClassificationArray(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "samplingRate": + err = unpopulate(val, "SamplingRate", &g.SamplingRate) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &g.SignalType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetBlobReferenceForConsumptionDto. +func (g GetBlobReferenceForConsumptionDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobUri", g.BlobURI) + populate(objectMap, "credential", g.Credential) + populate(objectMap, "storageAccountArmId", g.StorageAccountArmID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetBlobReferenceForConsumptionDto. +func (g *GetBlobReferenceForConsumptionDto) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobUri": + err = unpopulate(val, "BlobURI", &g.BlobURI) + delete(rawMsg, key) + case "credential": + g.Credential, err = unmarshalDataReferenceCredentialClassification(val) + delete(rawMsg, key) + case "storageAccountArmId": + err = unpopulate(val, "StorageAccountArmID", &g.StorageAccountArmID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetBlobReferenceSASRequestDto. +func (g GetBlobReferenceSASRequestDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assetId", g.AssetID) + populate(objectMap, "blobUri", g.BlobURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetBlobReferenceSASRequestDto. +func (g *GetBlobReferenceSASRequestDto) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assetId": + err = unpopulate(val, "AssetID", &g.AssetID) + delete(rawMsg, key) + case "blobUri": + err = unpopulate(val, "BlobURI", &g.BlobURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetBlobReferenceSASResponseDto. +func (g GetBlobReferenceSASResponseDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobReferenceForConsumption", g.BlobReferenceForConsumption) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetBlobReferenceSASResponseDto. +func (g *GetBlobReferenceSASResponseDto) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobReferenceForConsumption": + err = unpopulate(val, "BlobReferenceForConsumption", &g.BlobReferenceForConsumption) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GridSamplingAlgorithm. +func (g GridSamplingAlgorithm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeGrid + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GridSamplingAlgorithm. +func (g *GridSamplingAlgorithm) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &g.SamplingAlgorithmType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupStatus. +func (g GroupStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actualCapacityInfo", g.ActualCapacityInfo) + populate(objectMap, "bonusExtraCapacity", g.BonusExtraCapacity) + populate(objectMap, "endpointCount", g.EndpointCount) + populate(objectMap, "requestedCapacity", g.RequestedCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupStatus. +func (g *GroupStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actualCapacityInfo": + err = unpopulate(val, "ActualCapacityInfo", &g.ActualCapacityInfo) + delete(rawMsg, key) + case "bonusExtraCapacity": + err = unpopulate(val, "BonusExtraCapacity", &g.BonusExtraCapacity) + delete(rawMsg, key) + case "endpointCount": + err = unpopulate(val, "EndpointCount", &g.EndpointCount) + delete(rawMsg, key) + case "requestedCapacity": + err = unpopulate(val, "RequestedCapacity", &g.RequestedCapacity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HDInsight. +func (h HDInsight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeLocation", h.ComputeLocation) + objectMap["computeType"] = ComputeTypeHDInsight + populateDateTimeRFC3339(objectMap, "createdOn", h.CreatedOn) + populate(objectMap, "description", h.Description) + populate(objectMap, "disableLocalAuth", h.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", h.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", h.ModifiedOn) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "provisioningErrors", h.ProvisioningErrors) + populate(objectMap, "provisioningState", h.ProvisioningState) + populate(objectMap, "resourceId", h.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsight. +func (h *HDInsight) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &h.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &h.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &h.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &h.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &h.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &h.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &h.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &h.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HDInsightProperties. +func (h HDInsightProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", h.Address) + populate(objectMap, "administratorAccount", h.AdministratorAccount) + populate(objectMap, "sshPort", h.SSHPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightProperties. +func (h *HDInsightProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address": + err = unpopulate(val, "Address", &h.Address) + delete(rawMsg, key) + case "administratorAccount": + err = unpopulate(val, "AdministratorAccount", &h.AdministratorAccount) + delete(rawMsg, key) + case "sshPort": + err = unpopulate(val, "SSHPort", &h.SSHPort) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HDInsightSchema. +func (h HDInsightSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightSchema. +func (h *HDInsightSchema) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HdfsDatastore. +func (h HdfsDatastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", h.Credentials) + objectMap["datastoreType"] = DatastoreTypeHdfs + populate(objectMap, "description", h.Description) + populate(objectMap, "hdfsServerCertificate", h.HdfsServerCertificate) + populate(objectMap, "intellectualProperty", h.IntellectualProperty) + populate(objectMap, "isDefault", h.IsDefault) + populate(objectMap, "nameNodeAddress", h.NameNodeAddress) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "protocol", h.Protocol) + populate(objectMap, "tags", h.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HdfsDatastore. +func (h *HdfsDatastore) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentials": + h.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &h.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "hdfsServerCertificate": + err = unpopulate(val, "HdfsServerCertificate", &h.HdfsServerCertificate) + delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &h.IntellectualProperty) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &h.IsDefault) + delete(rawMsg, key) + case "nameNodeAddress": + err = unpopulate(val, "NameNodeAddress", &h.NameNodeAddress) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &h.Protocol) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &h.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IDAssetReference. +func (i IDAssetReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assetId", i.AssetID) + objectMap["referenceType"] = ReferenceTypeID + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IDAssetReference. +func (i *IDAssetReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assetId": + err = unpopulate(val, "AssetID", &i.AssetID) + delete(rawMsg, key) + case "referenceType": + err = unpopulate(val, "ReferenceType", &i.ReferenceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityConfiguration. +func (i IdentityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["identityType"] = i.IdentityType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityConfiguration. +func (i *IdentityConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identityType": + err = unpopulate(val, "IdentityType", &i.IdentityType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityForCmk. +func (i IdentityForCmk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "userAssignedIdentity", i.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityForCmk. +func (i *IdentityForCmk) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &i.UserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdleShutdownSetting. +func (i IdleShutdownSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "idleTimeBeforeShutdown", i.IdleTimeBeforeShutdown) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdleShutdownSetting. +func (i *IdleShutdownSetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "idleTimeBeforeShutdown": + err = unpopulate(val, "IdleTimeBeforeShutdown", &i.IdleTimeBeforeShutdown) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Image. +func (i Image) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "reference", i.Reference) + populate(objectMap, "type", i.Type) + populate(objectMap, "version", i.Version) + if i.AdditionalProperties != nil { + for key, val := range i.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Image. +func (i *Image) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "reference": + err = unpopulate(val, "Reference", &i.Reference) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &i.Version) + delete(rawMsg, key) + default: + if i.AdditionalProperties == nil { + i.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + i.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageClassification. +func (i ImageClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "logVerbosity", i.LogVerbosity) + populate(objectMap, "modelSettings", i.ModelSettings) + populate(objectMap, "primaryMetric", i.PrimaryMetric) + populate(objectMap, "searchSpace", i.SearchSpace) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "targetColumnName", i.TargetColumnName) + objectMap["taskType"] = TaskTypeImageClassification + populate(objectMap, "trainingData", i.TrainingData) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageClassification. +func (i *ImageClassification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &i.ModelSettings) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &i.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &i.TaskType) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &i.TrainingData) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageClassificationBase. +func (i ImageClassificationBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "modelSettings", i.ModelSettings) + populate(objectMap, "searchSpace", i.SearchSpace) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageClassificationBase. +func (i *ImageClassificationBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &i.ModelSettings) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &i.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageClassificationMultilabel. +func (i ImageClassificationMultilabel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "logVerbosity", i.LogVerbosity) + populate(objectMap, "modelSettings", i.ModelSettings) + populate(objectMap, "primaryMetric", i.PrimaryMetric) + populate(objectMap, "searchSpace", i.SearchSpace) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "targetColumnName", i.TargetColumnName) + objectMap["taskType"] = TaskTypeImageClassificationMultilabel + populate(objectMap, "trainingData", i.TrainingData) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageClassificationMultilabel. +func (i *ImageClassificationMultilabel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &i.ModelSettings) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &i.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &i.TaskType) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &i.TrainingData) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageInstanceSegmentation. +func (i ImageInstanceSegmentation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "logVerbosity", i.LogVerbosity) + populate(objectMap, "modelSettings", i.ModelSettings) + populate(objectMap, "primaryMetric", i.PrimaryMetric) + populate(objectMap, "searchSpace", i.SearchSpace) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "targetColumnName", i.TargetColumnName) + objectMap["taskType"] = TaskTypeImageInstanceSegmentation + populate(objectMap, "trainingData", i.TrainingData) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageInstanceSegmentation. +func (i *ImageInstanceSegmentation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &i.ModelSettings) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &i.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &i.TaskType) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &i.TrainingData) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageLimitSettings. +func (i ImageLimitSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxConcurrentTrials", i.MaxConcurrentTrials) + populate(objectMap, "maxTrials", i.MaxTrials) + populate(objectMap, "timeout", i.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageLimitSettings. +func (i *ImageLimitSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxConcurrentTrials": + err = unpopulate(val, "MaxConcurrentTrials", &i.MaxConcurrentTrials) + delete(rawMsg, key) + case "maxTrials": + err = unpopulate(val, "MaxTrials", &i.MaxTrials) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &i.Timeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageMetadata. +func (i ImageMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentImageVersion", i.CurrentImageVersion) + populate(objectMap, "isLatestOsImageVersion", i.IsLatestOsImageVersion) + populate(objectMap, "latestImageVersion", i.LatestImageVersion) + populate(objectMap, "osPatchingStatus", i.OSPatchingStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageMetadata. +func (i *ImageMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentImageVersion": + err = unpopulate(val, "CurrentImageVersion", &i.CurrentImageVersion) + delete(rawMsg, key) + case "isLatestOsImageVersion": + err = unpopulate(val, "IsLatestOsImageVersion", &i.IsLatestOsImageVersion) + delete(rawMsg, key) + case "latestImageVersion": + err = unpopulate(val, "LatestImageVersion", &i.LatestImageVersion) + delete(rawMsg, key) + case "osPatchingStatus": + err = unpopulate(val, "OSPatchingStatus", &i.OSPatchingStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageModelDistributionSettings. +func (i ImageModelDistributionSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "amsGradient", i.AmsGradient) + populate(objectMap, "augmentations", i.Augmentations) + populate(objectMap, "beta1", i.Beta1) + populate(objectMap, "beta2", i.Beta2) + populate(objectMap, "distributed", i.Distributed) + populate(objectMap, "earlyStopping", i.EarlyStopping) + populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) + populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) + populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) + populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) + populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) + populate(objectMap, "layersToFreeze", i.LayersToFreeze) + populate(objectMap, "learningRate", i.LearningRate) + populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) + populate(objectMap, "modelName", i.ModelName) + populate(objectMap, "momentum", i.Momentum) + populate(objectMap, "nesterov", i.Nesterov) + populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) + populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) + populate(objectMap, "optimizer", i.Optimizer) + populate(objectMap, "randomSeed", i.RandomSeed) + populate(objectMap, "stepLRGamma", i.StepLRGamma) + populate(objectMap, "stepLRStepSize", i.StepLRStepSize) + populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) + populate(objectMap, "validationBatchSize", i.ValidationBatchSize) + populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) + populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) + populate(objectMap, "weightDecay", i.WeightDecay) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelDistributionSettings. +func (i *ImageModelDistributionSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "amsGradient": + err = unpopulate(val, "AmsGradient", &i.AmsGradient) + delete(rawMsg, key) + case "augmentations": + err = unpopulate(val, "Augmentations", &i.Augmentations) + delete(rawMsg, key) + case "beta1": + err = unpopulate(val, "Beta1", &i.Beta1) + delete(rawMsg, key) + case "beta2": + err = unpopulate(val, "Beta2", &i.Beta2) + delete(rawMsg, key) + case "distributed": + err = unpopulate(val, "Distributed", &i.Distributed) + delete(rawMsg, key) + case "earlyStopping": + err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + delete(rawMsg, key) + case "earlyStoppingDelay": + err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + delete(rawMsg, key) + case "earlyStoppingPatience": + err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + delete(rawMsg, key) + case "enableOnnxNormalization": + err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + delete(rawMsg, key) + case "evaluationFrequency": + err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + delete(rawMsg, key) + case "gradientAccumulationStep": + err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + delete(rawMsg, key) + case "layersToFreeze": + err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &i.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &i.ModelName) + delete(rawMsg, key) + case "momentum": + err = unpopulate(val, "Momentum", &i.Momentum) + delete(rawMsg, key) + case "nesterov": + err = unpopulate(val, "Nesterov", &i.Nesterov) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + delete(rawMsg, key) + case "optimizer": + err = unpopulate(val, "Optimizer", &i.Optimizer) + delete(rawMsg, key) + case "randomSeed": + err = unpopulate(val, "RandomSeed", &i.RandomSeed) + delete(rawMsg, key) + case "stepLRGamma": + err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + delete(rawMsg, key) + case "stepLRStepSize": + err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + delete(rawMsg, key) + case "warmupCosineLRCycles": + err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + delete(rawMsg, key) + case "warmupCosineLRWarmupEpochs": + err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &i.WeightDecay) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageModelDistributionSettingsClassification. +func (i ImageModelDistributionSettingsClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "amsGradient", i.AmsGradient) + populate(objectMap, "augmentations", i.Augmentations) + populate(objectMap, "beta1", i.Beta1) + populate(objectMap, "beta2", i.Beta2) + populate(objectMap, "distributed", i.Distributed) + populate(objectMap, "earlyStopping", i.EarlyStopping) + populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) + populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) + populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) + populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) + populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) + populate(objectMap, "layersToFreeze", i.LayersToFreeze) + populate(objectMap, "learningRate", i.LearningRate) + populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) + populate(objectMap, "modelName", i.ModelName) + populate(objectMap, "momentum", i.Momentum) + populate(objectMap, "nesterov", i.Nesterov) + populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) + populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) + populate(objectMap, "optimizer", i.Optimizer) + populate(objectMap, "randomSeed", i.RandomSeed) + populate(objectMap, "stepLRGamma", i.StepLRGamma) + populate(objectMap, "stepLRStepSize", i.StepLRStepSize) + populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) + populate(objectMap, "trainingCropSize", i.TrainingCropSize) + populate(objectMap, "validationBatchSize", i.ValidationBatchSize) + populate(objectMap, "validationCropSize", i.ValidationCropSize) + populate(objectMap, "validationResizeSize", i.ValidationResizeSize) + populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) + populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) + populate(objectMap, "weightDecay", i.WeightDecay) + populate(objectMap, "weightedLoss", i.WeightedLoss) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelDistributionSettingsClassification. +func (i *ImageModelDistributionSettingsClassification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "amsGradient": + err = unpopulate(val, "AmsGradient", &i.AmsGradient) + delete(rawMsg, key) + case "augmentations": + err = unpopulate(val, "Augmentations", &i.Augmentations) + delete(rawMsg, key) + case "beta1": + err = unpopulate(val, "Beta1", &i.Beta1) + delete(rawMsg, key) + case "beta2": + err = unpopulate(val, "Beta2", &i.Beta2) + delete(rawMsg, key) + case "distributed": + err = unpopulate(val, "Distributed", &i.Distributed) + delete(rawMsg, key) + case "earlyStopping": + err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + delete(rawMsg, key) + case "earlyStoppingDelay": + err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + delete(rawMsg, key) + case "earlyStoppingPatience": + err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + delete(rawMsg, key) + case "enableOnnxNormalization": + err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + delete(rawMsg, key) + case "evaluationFrequency": + err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + delete(rawMsg, key) + case "gradientAccumulationStep": + err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + delete(rawMsg, key) + case "layersToFreeze": + err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &i.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &i.ModelName) + delete(rawMsg, key) + case "momentum": + err = unpopulate(val, "Momentum", &i.Momentum) + delete(rawMsg, key) + case "nesterov": + err = unpopulate(val, "Nesterov", &i.Nesterov) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + delete(rawMsg, key) + case "optimizer": + err = unpopulate(val, "Optimizer", &i.Optimizer) + delete(rawMsg, key) + case "randomSeed": + err = unpopulate(val, "RandomSeed", &i.RandomSeed) + delete(rawMsg, key) + case "stepLRGamma": + err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + delete(rawMsg, key) + case "stepLRStepSize": + err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + delete(rawMsg, key) + case "trainingCropSize": + err = unpopulate(val, "TrainingCropSize", &i.TrainingCropSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + delete(rawMsg, key) + case "validationCropSize": + err = unpopulate(val, "ValidationCropSize", &i.ValidationCropSize) + delete(rawMsg, key) + case "validationResizeSize": + err = unpopulate(val, "ValidationResizeSize", &i.ValidationResizeSize) + delete(rawMsg, key) + case "warmupCosineLRCycles": + err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + delete(rawMsg, key) + case "warmupCosineLRWarmupEpochs": + err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &i.WeightDecay) + delete(rawMsg, key) + case "weightedLoss": + err = unpopulate(val, "WeightedLoss", &i.WeightedLoss) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageModelDistributionSettingsObjectDetection. +func (i ImageModelDistributionSettingsObjectDetection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "amsGradient", i.AmsGradient) + populate(objectMap, "augmentations", i.Augmentations) + populate(objectMap, "beta1", i.Beta1) + populate(objectMap, "beta2", i.Beta2) + populate(objectMap, "boxDetectionsPerImage", i.BoxDetectionsPerImage) + populate(objectMap, "boxScoreThreshold", i.BoxScoreThreshold) + populate(objectMap, "distributed", i.Distributed) + populate(objectMap, "earlyStopping", i.EarlyStopping) + populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) + populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) + populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) + populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) + populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) + populate(objectMap, "imageSize", i.ImageSize) + populate(objectMap, "layersToFreeze", i.LayersToFreeze) + populate(objectMap, "learningRate", i.LearningRate) + populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) + populate(objectMap, "maxSize", i.MaxSize) + populate(objectMap, "minSize", i.MinSize) + populate(objectMap, "modelName", i.ModelName) + populate(objectMap, "modelSize", i.ModelSize) + populate(objectMap, "momentum", i.Momentum) + populate(objectMap, "multiScale", i.MultiScale) + populate(objectMap, "nesterov", i.Nesterov) + populate(objectMap, "nmsIouThreshold", i.NmsIouThreshold) + populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) + populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) + populate(objectMap, "optimizer", i.Optimizer) + populate(objectMap, "randomSeed", i.RandomSeed) + populate(objectMap, "stepLRGamma", i.StepLRGamma) + populate(objectMap, "stepLRStepSize", i.StepLRStepSize) + populate(objectMap, "tileGridSize", i.TileGridSize) + populate(objectMap, "tileOverlapRatio", i.TileOverlapRatio) + populate(objectMap, "tilePredictionsNmsThreshold", i.TilePredictionsNmsThreshold) + populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) + populate(objectMap, "validationBatchSize", i.ValidationBatchSize) + populate(objectMap, "validationIouThreshold", i.ValidationIouThreshold) + populate(objectMap, "validationMetricType", i.ValidationMetricType) + populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) + populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) + populate(objectMap, "weightDecay", i.WeightDecay) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelDistributionSettingsObjectDetection. +func (i *ImageModelDistributionSettingsObjectDetection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "amsGradient": + err = unpopulate(val, "AmsGradient", &i.AmsGradient) + delete(rawMsg, key) + case "augmentations": + err = unpopulate(val, "Augmentations", &i.Augmentations) + delete(rawMsg, key) + case "beta1": + err = unpopulate(val, "Beta1", &i.Beta1) + delete(rawMsg, key) + case "beta2": + err = unpopulate(val, "Beta2", &i.Beta2) + delete(rawMsg, key) + case "boxDetectionsPerImage": + err = unpopulate(val, "BoxDetectionsPerImage", &i.BoxDetectionsPerImage) + delete(rawMsg, key) + case "boxScoreThreshold": + err = unpopulate(val, "BoxScoreThreshold", &i.BoxScoreThreshold) + delete(rawMsg, key) + case "distributed": + err = unpopulate(val, "Distributed", &i.Distributed) + delete(rawMsg, key) + case "earlyStopping": + err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + delete(rawMsg, key) + case "earlyStoppingDelay": + err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + delete(rawMsg, key) + case "earlyStoppingPatience": + err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + delete(rawMsg, key) + case "enableOnnxNormalization": + err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + delete(rawMsg, key) + case "evaluationFrequency": + err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + delete(rawMsg, key) + case "gradientAccumulationStep": + err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + delete(rawMsg, key) + case "imageSize": + err = unpopulate(val, "ImageSize", &i.ImageSize) + delete(rawMsg, key) + case "layersToFreeze": + err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &i.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + delete(rawMsg, key) + case "maxSize": + err = unpopulate(val, "MaxSize", &i.MaxSize) + delete(rawMsg, key) + case "minSize": + err = unpopulate(val, "MinSize", &i.MinSize) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &i.ModelName) + delete(rawMsg, key) + case "modelSize": + err = unpopulate(val, "ModelSize", &i.ModelSize) + delete(rawMsg, key) + case "momentum": + err = unpopulate(val, "Momentum", &i.Momentum) + delete(rawMsg, key) + case "multiScale": + err = unpopulate(val, "MultiScale", &i.MultiScale) + delete(rawMsg, key) + case "nesterov": + err = unpopulate(val, "Nesterov", &i.Nesterov) + delete(rawMsg, key) + case "nmsIouThreshold": + err = unpopulate(val, "NmsIouThreshold", &i.NmsIouThreshold) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + delete(rawMsg, key) + case "optimizer": + err = unpopulate(val, "Optimizer", &i.Optimizer) + delete(rawMsg, key) + case "randomSeed": + err = unpopulate(val, "RandomSeed", &i.RandomSeed) + delete(rawMsg, key) + case "stepLRGamma": + err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + delete(rawMsg, key) + case "stepLRStepSize": + err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + delete(rawMsg, key) + case "tileGridSize": + err = unpopulate(val, "TileGridSize", &i.TileGridSize) + delete(rawMsg, key) + case "tileOverlapRatio": + err = unpopulate(val, "TileOverlapRatio", &i.TileOverlapRatio) + delete(rawMsg, key) + case "tilePredictionsNmsThreshold": + err = unpopulate(val, "TilePredictionsNmsThreshold", &i.TilePredictionsNmsThreshold) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + delete(rawMsg, key) + case "validationIouThreshold": + err = unpopulate(val, "ValidationIouThreshold", &i.ValidationIouThreshold) + delete(rawMsg, key) + case "validationMetricType": + err = unpopulate(val, "ValidationMetricType", &i.ValidationMetricType) + delete(rawMsg, key) + case "warmupCosineLRCycles": + err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + delete(rawMsg, key) + case "warmupCosineLRWarmupEpochs": + err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &i.WeightDecay) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageModelSettings. +func (i ImageModelSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "advancedSettings", i.AdvancedSettings) + populate(objectMap, "amsGradient", i.AmsGradient) + populate(objectMap, "augmentations", i.Augmentations) + populate(objectMap, "beta1", i.Beta1) + populate(objectMap, "beta2", i.Beta2) + populate(objectMap, "checkpointFrequency", i.CheckpointFrequency) + populate(objectMap, "checkpointModel", i.CheckpointModel) + populate(objectMap, "checkpointRunId", i.CheckpointRunID) + populate(objectMap, "distributed", i.Distributed) + populate(objectMap, "earlyStopping", i.EarlyStopping) + populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) + populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) + populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) + populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) + populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) + populate(objectMap, "layersToFreeze", i.LayersToFreeze) + populate(objectMap, "learningRate", i.LearningRate) + populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) + populate(objectMap, "modelName", i.ModelName) + populate(objectMap, "momentum", i.Momentum) + populate(objectMap, "nesterov", i.Nesterov) + populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) + populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) + populate(objectMap, "optimizer", i.Optimizer) + populate(objectMap, "randomSeed", i.RandomSeed) + populate(objectMap, "stepLRGamma", i.StepLRGamma) + populate(objectMap, "stepLRStepSize", i.StepLRStepSize) + populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) + populate(objectMap, "validationBatchSize", i.ValidationBatchSize) + populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) + populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) + populate(objectMap, "weightDecay", i.WeightDecay) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelSettings. +func (i *ImageModelSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "advancedSettings": + err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) + delete(rawMsg, key) + case "amsGradient": + err = unpopulate(val, "AmsGradient", &i.AmsGradient) + delete(rawMsg, key) + case "augmentations": + err = unpopulate(val, "Augmentations", &i.Augmentations) + delete(rawMsg, key) + case "beta1": + err = unpopulate(val, "Beta1", &i.Beta1) + delete(rawMsg, key) + case "beta2": + err = unpopulate(val, "Beta2", &i.Beta2) + delete(rawMsg, key) + case "checkpointFrequency": + err = unpopulate(val, "CheckpointFrequency", &i.CheckpointFrequency) + delete(rawMsg, key) + case "checkpointModel": + err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) + delete(rawMsg, key) + case "checkpointRunId": + err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) + delete(rawMsg, key) + case "distributed": + err = unpopulate(val, "Distributed", &i.Distributed) + delete(rawMsg, key) + case "earlyStopping": + err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + delete(rawMsg, key) + case "earlyStoppingDelay": + err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + delete(rawMsg, key) + case "earlyStoppingPatience": + err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + delete(rawMsg, key) + case "enableOnnxNormalization": + err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + delete(rawMsg, key) + case "evaluationFrequency": + err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + delete(rawMsg, key) + case "gradientAccumulationStep": + err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + delete(rawMsg, key) + case "layersToFreeze": + err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &i.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &i.ModelName) + delete(rawMsg, key) + case "momentum": + err = unpopulate(val, "Momentum", &i.Momentum) + delete(rawMsg, key) + case "nesterov": + err = unpopulate(val, "Nesterov", &i.Nesterov) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + delete(rawMsg, key) + case "optimizer": + err = unpopulate(val, "Optimizer", &i.Optimizer) + delete(rawMsg, key) + case "randomSeed": + err = unpopulate(val, "RandomSeed", &i.RandomSeed) + delete(rawMsg, key) + case "stepLRGamma": + err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + delete(rawMsg, key) + case "stepLRStepSize": + err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + delete(rawMsg, key) + case "warmupCosineLRCycles": + err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + delete(rawMsg, key) + case "warmupCosineLRWarmupEpochs": + err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &i.WeightDecay) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageModelSettingsClassification. +func (i ImageModelSettingsClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "advancedSettings", i.AdvancedSettings) + populate(objectMap, "amsGradient", i.AmsGradient) + populate(objectMap, "augmentations", i.Augmentations) + populate(objectMap, "beta1", i.Beta1) + populate(objectMap, "beta2", i.Beta2) + populate(objectMap, "checkpointFrequency", i.CheckpointFrequency) + populate(objectMap, "checkpointModel", i.CheckpointModel) + populate(objectMap, "checkpointRunId", i.CheckpointRunID) + populate(objectMap, "distributed", i.Distributed) + populate(objectMap, "earlyStopping", i.EarlyStopping) + populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) + populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) + populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) + populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) + populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) + populate(objectMap, "layersToFreeze", i.LayersToFreeze) + populate(objectMap, "learningRate", i.LearningRate) + populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) + populate(objectMap, "modelName", i.ModelName) + populate(objectMap, "momentum", i.Momentum) + populate(objectMap, "nesterov", i.Nesterov) + populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) + populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) + populate(objectMap, "optimizer", i.Optimizer) + populate(objectMap, "randomSeed", i.RandomSeed) + populate(objectMap, "stepLRGamma", i.StepLRGamma) + populate(objectMap, "stepLRStepSize", i.StepLRStepSize) + populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) + populate(objectMap, "trainingCropSize", i.TrainingCropSize) + populate(objectMap, "validationBatchSize", i.ValidationBatchSize) + populate(objectMap, "validationCropSize", i.ValidationCropSize) + populate(objectMap, "validationResizeSize", i.ValidationResizeSize) + populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) + populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) + populate(objectMap, "weightDecay", i.WeightDecay) + populate(objectMap, "weightedLoss", i.WeightedLoss) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelSettingsClassification. +func (i *ImageModelSettingsClassification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "advancedSettings": + err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) + delete(rawMsg, key) + case "amsGradient": + err = unpopulate(val, "AmsGradient", &i.AmsGradient) + delete(rawMsg, key) + case "augmentations": + err = unpopulate(val, "Augmentations", &i.Augmentations) + delete(rawMsg, key) + case "beta1": + err = unpopulate(val, "Beta1", &i.Beta1) + delete(rawMsg, key) + case "beta2": + err = unpopulate(val, "Beta2", &i.Beta2) + delete(rawMsg, key) + case "checkpointFrequency": + err = unpopulate(val, "CheckpointFrequency", &i.CheckpointFrequency) + delete(rawMsg, key) + case "checkpointModel": + err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) + delete(rawMsg, key) + case "checkpointRunId": + err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) + delete(rawMsg, key) + case "distributed": + err = unpopulate(val, "Distributed", &i.Distributed) + delete(rawMsg, key) + case "earlyStopping": + err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + delete(rawMsg, key) + case "earlyStoppingDelay": + err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + delete(rawMsg, key) + case "earlyStoppingPatience": + err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + delete(rawMsg, key) + case "enableOnnxNormalization": + err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + delete(rawMsg, key) + case "evaluationFrequency": + err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + delete(rawMsg, key) + case "gradientAccumulationStep": + err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + delete(rawMsg, key) + case "layersToFreeze": + err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &i.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &i.ModelName) + delete(rawMsg, key) + case "momentum": + err = unpopulate(val, "Momentum", &i.Momentum) + delete(rawMsg, key) + case "nesterov": + err = unpopulate(val, "Nesterov", &i.Nesterov) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + delete(rawMsg, key) + case "optimizer": + err = unpopulate(val, "Optimizer", &i.Optimizer) + delete(rawMsg, key) + case "randomSeed": + err = unpopulate(val, "RandomSeed", &i.RandomSeed) + delete(rawMsg, key) + case "stepLRGamma": + err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + delete(rawMsg, key) + case "stepLRStepSize": + err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + delete(rawMsg, key) + case "trainingCropSize": + err = unpopulate(val, "TrainingCropSize", &i.TrainingCropSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + delete(rawMsg, key) + case "validationCropSize": + err = unpopulate(val, "ValidationCropSize", &i.ValidationCropSize) + delete(rawMsg, key) + case "validationResizeSize": + err = unpopulate(val, "ValidationResizeSize", &i.ValidationResizeSize) + delete(rawMsg, key) + case "warmupCosineLRCycles": + err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + delete(rawMsg, key) + case "warmupCosineLRWarmupEpochs": + err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &i.WeightDecay) + delete(rawMsg, key) + case "weightedLoss": + err = unpopulate(val, "WeightedLoss", &i.WeightedLoss) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageModelSettingsObjectDetection. +func (i ImageModelSettingsObjectDetection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "advancedSettings", i.AdvancedSettings) + populate(objectMap, "amsGradient", i.AmsGradient) + populate(objectMap, "augmentations", i.Augmentations) + populate(objectMap, "beta1", i.Beta1) + populate(objectMap, "beta2", i.Beta2) + populate(objectMap, "boxDetectionsPerImage", i.BoxDetectionsPerImage) + populate(objectMap, "boxScoreThreshold", i.BoxScoreThreshold) + populate(objectMap, "checkpointFrequency", i.CheckpointFrequency) + populate(objectMap, "checkpointModel", i.CheckpointModel) + populate(objectMap, "checkpointRunId", i.CheckpointRunID) + populate(objectMap, "distributed", i.Distributed) + populate(objectMap, "earlyStopping", i.EarlyStopping) + populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) + populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) + populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) + populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) + populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) + populate(objectMap, "imageSize", i.ImageSize) + populate(objectMap, "layersToFreeze", i.LayersToFreeze) + populate(objectMap, "learningRate", i.LearningRate) + populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) + populate(objectMap, "logTrainingMetrics", i.LogTrainingMetrics) + populate(objectMap, "logValidationLoss", i.LogValidationLoss) + populate(objectMap, "maxSize", i.MaxSize) + populate(objectMap, "minSize", i.MinSize) + populate(objectMap, "modelName", i.ModelName) + populate(objectMap, "modelSize", i.ModelSize) + populate(objectMap, "momentum", i.Momentum) + populate(objectMap, "multiScale", i.MultiScale) + populate(objectMap, "nesterov", i.Nesterov) + populate(objectMap, "nmsIouThreshold", i.NmsIouThreshold) + populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) + populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) + populate(objectMap, "optimizer", i.Optimizer) + populate(objectMap, "randomSeed", i.RandomSeed) + populate(objectMap, "stepLRGamma", i.StepLRGamma) + populate(objectMap, "stepLRStepSize", i.StepLRStepSize) + populate(objectMap, "tileGridSize", i.TileGridSize) + populate(objectMap, "tileOverlapRatio", i.TileOverlapRatio) + populate(objectMap, "tilePredictionsNmsThreshold", i.TilePredictionsNmsThreshold) + populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) + populate(objectMap, "validationBatchSize", i.ValidationBatchSize) + populate(objectMap, "validationIouThreshold", i.ValidationIouThreshold) + populate(objectMap, "validationMetricType", i.ValidationMetricType) + populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) + populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) + populate(objectMap, "weightDecay", i.WeightDecay) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelSettingsObjectDetection. +func (i *ImageModelSettingsObjectDetection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "advancedSettings": + err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) + delete(rawMsg, key) + case "amsGradient": + err = unpopulate(val, "AmsGradient", &i.AmsGradient) + delete(rawMsg, key) + case "augmentations": + err = unpopulate(val, "Augmentations", &i.Augmentations) + delete(rawMsg, key) + case "beta1": + err = unpopulate(val, "Beta1", &i.Beta1) + delete(rawMsg, key) + case "beta2": + err = unpopulate(val, "Beta2", &i.Beta2) + delete(rawMsg, key) + case "boxDetectionsPerImage": + err = unpopulate(val, "BoxDetectionsPerImage", &i.BoxDetectionsPerImage) + delete(rawMsg, key) + case "boxScoreThreshold": + err = unpopulate(val, "BoxScoreThreshold", &i.BoxScoreThreshold) + delete(rawMsg, key) + case "checkpointFrequency": + err = unpopulate(val, "CheckpointFrequency", &i.CheckpointFrequency) + delete(rawMsg, key) + case "checkpointModel": + err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) + delete(rawMsg, key) + case "checkpointRunId": + err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) + delete(rawMsg, key) + case "distributed": + err = unpopulate(val, "Distributed", &i.Distributed) delete(rawMsg, key) case "earlyStopping": err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + case "earlyStoppingDelay": + err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + delete(rawMsg, key) + case "earlyStoppingPatience": + err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + delete(rawMsg, key) + case "enableOnnxNormalization": + err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + delete(rawMsg, key) + case "evaluationFrequency": + err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + delete(rawMsg, key) + case "gradientAccumulationStep": + err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + delete(rawMsg, key) + case "imageSize": + err = unpopulate(val, "ImageSize", &i.ImageSize) + delete(rawMsg, key) + case "layersToFreeze": + err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &i.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + delete(rawMsg, key) + case "logTrainingMetrics": + err = unpopulate(val, "LogTrainingMetrics", &i.LogTrainingMetrics) + delete(rawMsg, key) + case "logValidationLoss": + err = unpopulate(val, "LogValidationLoss", &i.LogValidationLoss) + delete(rawMsg, key) + case "maxSize": + err = unpopulate(val, "MaxSize", &i.MaxSize) + delete(rawMsg, key) + case "minSize": + err = unpopulate(val, "MinSize", &i.MinSize) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &i.ModelName) + delete(rawMsg, key) + case "modelSize": + err = unpopulate(val, "ModelSize", &i.ModelSize) + delete(rawMsg, key) + case "momentum": + err = unpopulate(val, "Momentum", &i.Momentum) + delete(rawMsg, key) + case "multiScale": + err = unpopulate(val, "MultiScale", &i.MultiScale) + delete(rawMsg, key) + case "nesterov": + err = unpopulate(val, "Nesterov", &i.Nesterov) + delete(rawMsg, key) + case "nmsIouThreshold": + err = unpopulate(val, "NmsIouThreshold", &i.NmsIouThreshold) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + delete(rawMsg, key) + case "optimizer": + err = unpopulate(val, "Optimizer", &i.Optimizer) + delete(rawMsg, key) + case "randomSeed": + err = unpopulate(val, "RandomSeed", &i.RandomSeed) + delete(rawMsg, key) + case "stepLRGamma": + err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + delete(rawMsg, key) + case "stepLRStepSize": + err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + delete(rawMsg, key) + case "tileGridSize": + err = unpopulate(val, "TileGridSize", &i.TileGridSize) + delete(rawMsg, key) + case "tileOverlapRatio": + err = unpopulate(val, "TileOverlapRatio", &i.TileOverlapRatio) + delete(rawMsg, key) + case "tilePredictionsNmsThreshold": + err = unpopulate(val, "TilePredictionsNmsThreshold", &i.TilePredictionsNmsThreshold) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + delete(rawMsg, key) + case "validationIouThreshold": + err = unpopulate(val, "ValidationIouThreshold", &i.ValidationIouThreshold) + delete(rawMsg, key) + case "validationMetricType": + err = unpopulate(val, "ValidationMetricType", &i.ValidationMetricType) + delete(rawMsg, key) + case "warmupCosineLRCycles": + err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + delete(rawMsg, key) + case "warmupCosineLRWarmupEpochs": + err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &i.WeightDecay) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageObjectDetection. +func (i ImageObjectDetection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "logVerbosity", i.LogVerbosity) + populate(objectMap, "modelSettings", i.ModelSettings) + populate(objectMap, "primaryMetric", i.PrimaryMetric) + populate(objectMap, "searchSpace", i.SearchSpace) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "targetColumnName", i.TargetColumnName) + objectMap["taskType"] = TaskTypeImageObjectDetection + populate(objectMap, "trainingData", i.TrainingData) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageObjectDetection. +func (i *ImageObjectDetection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &i.ModelSettings) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &i.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &i.TaskType) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &i.TrainingData) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageObjectDetectionBase. +func (i ImageObjectDetectionBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "modelSettings", i.ModelSettings) + populate(objectMap, "searchSpace", i.SearchSpace) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageObjectDetectionBase. +func (i *ImageObjectDetectionBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &i.ModelSettings) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &i.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageSweepSettings. +func (i ImageSweepSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "earlyTermination", i.EarlyTermination) + populate(objectMap, "samplingAlgorithm", i.SamplingAlgorithm) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageSweepSettings. +func (i *ImageSweepSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "earlyTermination": + i.EarlyTermination, err = unmarshalEarlyTerminationPolicyClassification(val) + delete(rawMsg, key) + case "samplingAlgorithm": + err = unpopulate(val, "SamplingAlgorithm", &i.SamplingAlgorithm) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageVertical. +func (i ImageVertical) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limitSettings", i.LimitSettings) + populate(objectMap, "sweepSettings", i.SweepSettings) + populate(objectMap, "validationData", i.ValidationData) + populate(objectMap, "validationDataSize", i.ValidationDataSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageVertical. +func (i *ImageVertical) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limitSettings": + err = unpopulate(val, "LimitSettings", &i.LimitSettings) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &i.SweepSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &i.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportDataAction. +func (i ImportDataAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["actionType"] = ScheduleActionTypeImportData + populate(objectMap, "dataImportDefinition", i.DataImportDefinition) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportDataAction. +func (i *ImportDataAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &i.ActionType) + delete(rawMsg, key) + case "dataImportDefinition": + err = unpopulate(val, "DataImportDefinition", &i.DataImportDefinition) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IndexColumn. +func (i IndexColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columnName", i.ColumnName) + populate(objectMap, "dataType", i.DataType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IndexColumn. +func (i *IndexColumn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columnName": + err = unpopulate(val, "ColumnName", &i.ColumnName) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &i.DataType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceContainerProperties. +func (i InferenceContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "livenessRoute", i.LivenessRoute) + populate(objectMap, "readinessRoute", i.ReadinessRoute) + populate(objectMap, "scoringRoute", i.ScoringRoute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceContainerProperties. +func (i *InferenceContainerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "livenessRoute": + err = unpopulate(val, "LivenessRoute", &i.LivenessRoute) + delete(rawMsg, key) + case "readinessRoute": + err = unpopulate(val, "ReadinessRoute", &i.ReadinessRoute) + delete(rawMsg, key) + case "scoringRoute": + err = unpopulate(val, "ScoringRoute", &i.ScoringRoute) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceEndpoint. +func (i InferenceEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "identity", i.Identity) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "sku", i.SKU) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceEndpoint. +func (i *InferenceEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &i.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &i.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceEndpointProperties. +func (i InferenceEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authMode", i.AuthMode) + populate(objectMap, "description", i.Description) + populate(objectMap, "endpointUri", i.EndpointURI) + populate(objectMap, "groupId", i.GroupID) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "provisioningState", i.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceEndpointProperties. +func (i *InferenceEndpointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authMode": + err = unpopulate(val, "AuthMode", &i.AuthMode) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "endpointUri": + err = unpopulate(val, "EndpointURI", &i.EndpointURI) + delete(rawMsg, key) + case "groupId": + err = unpopulate(val, "GroupID", &i.GroupID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceEndpointTrackedResourceArmPaginatedResult. +func (i InferenceEndpointTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceEndpointTrackedResourceArmPaginatedResult. +func (i *InferenceEndpointTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceGroup. +func (i InferenceGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "identity", i.Identity) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "sku", i.SKU) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceGroup. +func (i *InferenceGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &i.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &i.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceGroupProperties. +func (i InferenceGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bonusExtraCapacity", i.BonusExtraCapacity) + populate(objectMap, "description", i.Description) + populate(objectMap, "metadata", i.Metadata) + populate(objectMap, "priority", i.Priority) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "provisioningState", i.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceGroupProperties. +func (i *InferenceGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bonusExtraCapacity": + err = unpopulate(val, "BonusExtraCapacity", &i.BonusExtraCapacity) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &i.Metadata) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &i.Priority) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferenceGroupTrackedResourceArmPaginatedResult. +func (i InferenceGroupTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceGroupTrackedResourceArmPaginatedResult. +func (i *InferenceGroupTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferencePool. +func (i InferencePool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "identity", i.Identity) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "sku", i.SKU) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferencePool. +func (i *InferencePool) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &i.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &i.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferencePoolProperties. +func (i InferencePoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "codeConfiguration", i.CodeConfiguration) + populate(objectMap, "description", i.Description) + populate(objectMap, "environmentConfiguration", i.EnvironmentConfiguration) + populate(objectMap, "modelConfiguration", i.ModelConfiguration) + populate(objectMap, "nodeSkuType", i.NodeSKUType) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "requestConfiguration", i.RequestConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferencePoolProperties. +func (i *InferencePoolProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &i.CodeConfiguration) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "environmentConfiguration": + err = unpopulate(val, "EnvironmentConfiguration", &i.EnvironmentConfiguration) + delete(rawMsg, key) + case "modelConfiguration": + err = unpopulate(val, "ModelConfiguration", &i.ModelConfiguration) + delete(rawMsg, key) + case "nodeSkuType": + err = unpopulate(val, "NodeSKUType", &i.NodeSKUType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "requestConfiguration": + err = unpopulate(val, "RequestConfiguration", &i.RequestConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferencePoolTrackedResourceArmPaginatedResult. +func (i InferencePoolTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferencePoolTrackedResourceArmPaginatedResult. +func (i *InferencePoolTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InferencingServer. +func (i InferencingServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["serverType"] = i.ServerType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InferencingServer. +func (i *InferencingServer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serverType": + err = unpopulate(val, "ServerType", &i.ServerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceTypeSchema. +func (i InstanceTypeSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nodeSelector", i.NodeSelector) + populate(objectMap, "resources", i.Resources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceTypeSchema. +func (i *InstanceTypeSchema) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nodeSelector": + err = unpopulate(val, "NodeSelector", &i.NodeSelector) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &i.Resources) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceTypeSchemaResources. +func (i InstanceTypeSchemaResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limits", i.Limits) + populate(objectMap, "requests", i.Requests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceTypeSchemaResources. +func (i *InstanceTypeSchemaResources) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limits": + err = unpopulate(val, "Limits", &i.Limits) + delete(rawMsg, key) + case "requests": + err = unpopulate(val, "Requests", &i.Requests) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IntellectualProperty. +func (i IntellectualProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "protectionLevel", i.ProtectionLevel) + populate(objectMap, "publisher", i.Publisher) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IntellectualProperty. +func (i *IntellectualProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "protectionLevel": + err = unpopulate(val, "ProtectionLevel", &i.ProtectionLevel) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &i.Publisher) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobBase. +func (j JobBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "systemData", j.SystemData) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobBase. +func (j *JobBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + j.Properties, err = unmarshalJobBasePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &j.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobBaseProperties. +func (j JobBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "componentId", j.ComponentID) + populate(objectMap, "computeId", j.ComputeID) + populate(objectMap, "description", j.Description) + populate(objectMap, "displayName", j.DisplayName) + populate(objectMap, "experimentName", j.ExperimentName) + populate(objectMap, "identity", j.Identity) + populate(objectMap, "isArchived", j.IsArchived) + objectMap["jobType"] = j.JobType + populate(objectMap, "notificationSetting", j.NotificationSetting) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "secretsConfiguration", j.SecretsConfiguration) + populate(objectMap, "services", j.Services) + populate(objectMap, "status", j.Status) + populate(objectMap, "tags", j.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobBaseProperties. +func (j *JobBaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "componentId": + err = unpopulate(val, "ComponentID", &j.ComponentID) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &j.ComputeID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &j.DisplayName) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &j.ExperimentName) + delete(rawMsg, key) + case "identity": + j.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &j.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &j.JobType) + delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &j.NotificationSetting) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &j.SecretsConfiguration) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &j.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobBaseResourceArmPaginatedResult. +func (j JobBaseResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobBaseResourceArmPaginatedResult. +func (j *JobBaseResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobInput. +func (j JobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", j.Description) + objectMap["jobInputType"] = j.JobInputType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobInput. +func (j *JobInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &j.JobInputType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobLimits. +func (j JobLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["jobLimitsType"] = j.JobLimitsType + populate(objectMap, "timeout", j.Timeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobLimits. +func (j *JobLimits) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "jobLimitsType": + err = unpopulate(val, "JobLimitsType", &j.JobLimitsType) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &j.Timeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobOutput. +func (j JobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", j.Description) + objectMap["jobOutputType"] = j.JobOutputType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobOutput. +func (j *JobOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &j.JobOutputType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobResourceConfiguration. +func (j JobResourceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dockerArgs", j.DockerArgs) + populate(objectMap, "instanceCount", j.InstanceCount) + populate(objectMap, "instanceType", j.InstanceType) + populate(objectMap, "locations", j.Locations) + populate(objectMap, "maxInstanceCount", j.MaxInstanceCount) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "shmSize", j.ShmSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobResourceConfiguration. +func (j *JobResourceConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dockerArgs": + err = unpopulate(val, "DockerArgs", &j.DockerArgs) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &j.InstanceCount) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &j.InstanceType) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &j.Locations) + delete(rawMsg, key) + case "maxInstanceCount": + err = unpopulate(val, "MaxInstanceCount", &j.MaxInstanceCount) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "shmSize": + err = unpopulate(val, "ShmSize", &j.ShmSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobScheduleAction. +func (j JobScheduleAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["actionType"] = ScheduleActionTypeCreateJob + populate(objectMap, "jobDefinition", j.JobDefinition) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobScheduleAction. +func (j *JobScheduleAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &j.ActionType) + delete(rawMsg, key) + case "jobDefinition": + j.JobDefinition, err = unmarshalJobBasePropertiesClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobService. +func (j JobService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endpoint", j.Endpoint) + populate(objectMap, "errorMessage", j.ErrorMessage) + populate(objectMap, "jobServiceType", j.JobServiceType) + populate(objectMap, "nodes", j.Nodes) + populate(objectMap, "port", j.Port) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobService. +func (j *JobService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpoint": + err = unpopulate(val, "Endpoint", &j.Endpoint) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &j.ErrorMessage) + delete(rawMsg, key) + case "jobServiceType": + err = unpopulate(val, "JobServiceType", &j.JobServiceType) + delete(rawMsg, key) + case "nodes": + j.Nodes, err = unmarshalNodesClassification(val) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &j.Port) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JupyterKernelConfig. +func (j JupyterKernelConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "argv", j.Argv) + populate(objectMap, "displayName", j.DisplayName) + populate(objectMap, "language", j.Language) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JupyterKernelConfig. +func (j *JupyterKernelConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "argv": + err = unpopulate(val, "Argv", &j.Argv) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &j.DisplayName) + delete(rawMsg, key) + case "language": + err = unpopulate(val, "Language", &j.Language) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KerberosCredentials. +func (k KerberosCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kerberosKdcAddress", k.KerberosKdcAddress) + populate(objectMap, "kerberosPrincipal", k.KerberosPrincipal) + populate(objectMap, "kerberosRealm", k.KerberosRealm) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KerberosCredentials. +func (k *KerberosCredentials) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kerberosKdcAddress": + err = unpopulate(val, "KerberosKdcAddress", &k.KerberosKdcAddress) + delete(rawMsg, key) + case "kerberosPrincipal": + err = unpopulate(val, "KerberosPrincipal", &k.KerberosPrincipal) + delete(rawMsg, key) + case "kerberosRealm": + err = unpopulate(val, "KerberosRealm", &k.KerberosRealm) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KerberosKeytabCredentials. +func (k KerberosKeytabCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["credentialsType"] = CredentialsTypeKerberosKeytab + populate(objectMap, "kerberosKdcAddress", k.KerberosKdcAddress) + populate(objectMap, "kerberosPrincipal", k.KerberosPrincipal) + populate(objectMap, "kerberosRealm", k.KerberosRealm) + populate(objectMap, "secrets", k.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KerberosKeytabCredentials. +func (k *KerberosKeytabCredentials) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentialsType": + err = unpopulate(val, "CredentialsType", &k.CredentialsType) + delete(rawMsg, key) + case "kerberosKdcAddress": + err = unpopulate(val, "KerberosKdcAddress", &k.KerberosKdcAddress) + delete(rawMsg, key) + case "kerberosPrincipal": + err = unpopulate(val, "KerberosPrincipal", &k.KerberosPrincipal) + delete(rawMsg, key) + case "kerberosRealm": + err = unpopulate(val, "KerberosRealm", &k.KerberosRealm) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &k.Secrets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KerberosKeytabSecrets. +func (k KerberosKeytabSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kerberosKeytab", k.KerberosKeytab) + objectMap["secretsType"] = SecretsTypeKerberosKeytab + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KerberosKeytabSecrets. +func (k *KerberosKeytabSecrets) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kerberosKeytab": + err = unpopulate(val, "KerberosKeytab", &k.KerberosKeytab) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &k.SecretsType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KerberosPasswordCredentials. +func (k KerberosPasswordCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["credentialsType"] = CredentialsTypeKerberosPassword + populate(objectMap, "kerberosKdcAddress", k.KerberosKdcAddress) + populate(objectMap, "kerberosPrincipal", k.KerberosPrincipal) + populate(objectMap, "kerberosRealm", k.KerberosRealm) + populate(objectMap, "secrets", k.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KerberosPasswordCredentials. +func (k *KerberosPasswordCredentials) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentialsType": + err = unpopulate(val, "CredentialsType", &k.CredentialsType) + delete(rawMsg, key) + case "kerberosKdcAddress": + err = unpopulate(val, "KerberosKdcAddress", &k.KerberosKdcAddress) + delete(rawMsg, key) + case "kerberosPrincipal": + err = unpopulate(val, "KerberosPrincipal", &k.KerberosPrincipal) + delete(rawMsg, key) + case "kerberosRealm": + err = unpopulate(val, "KerberosRealm", &k.KerberosRealm) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &k.Secrets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KerberosPasswordSecrets. +func (k KerberosPasswordSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kerberosPassword", k.KerberosPassword) + objectMap["secretsType"] = SecretsTypeKerberosPassword + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KerberosPasswordSecrets. +func (k *KerberosPasswordSecrets) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kerberosPassword": + err = unpopulate(val, "KerberosPassword", &k.KerberosPassword) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &k.SecretsType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identityClientId", k.IdentityClientID) + populate(objectMap, "keyIdentifier", k.KeyIdentifier) + populate(objectMap, "keyVaultArmId", k.KeyVaultArmID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identityClientId": + err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) + delete(rawMsg, key) + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &k.KeyIdentifier) + delete(rawMsg, key) + case "keyVaultArmId": + err = unpopulate(val, "KeyVaultArmID", &k.KeyVaultArmID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Kubernetes. +func (k Kubernetes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeLocation", k.ComputeLocation) + objectMap["computeType"] = ComputeTypeKubernetes + populateDateTimeRFC3339(objectMap, "createdOn", k.CreatedOn) + populate(objectMap, "description", k.Description) + populate(objectMap, "disableLocalAuth", k.DisableLocalAuth) + populate(objectMap, "isAttachedCompute", k.IsAttachedCompute) + populateDateTimeRFC3339(objectMap, "modifiedOn", k.ModifiedOn) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "provisioningErrors", k.ProvisioningErrors) + populate(objectMap, "provisioningState", k.ProvisioningState) + populate(objectMap, "resourceId", k.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Kubernetes. +func (k *Kubernetes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeLocation": + err = unpopulate(val, "ComputeLocation", &k.ComputeLocation) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &k.ComputeType) + delete(rawMsg, key) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &k.CreatedOn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &k.Description) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &k.DisableLocalAuth) + delete(rawMsg, key) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &k.IsAttachedCompute) + delete(rawMsg, key) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &k.ModifiedOn) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &k.ProvisioningErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &k.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesOnlineDeployment. +func (k KubernetesOnlineDeployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appInsightsEnabled", k.AppInsightsEnabled) + populate(objectMap, "codeConfiguration", k.CodeConfiguration) + populate(objectMap, "containerResourceRequirements", k.ContainerResourceRequirements) + populate(objectMap, "dataCollector", k.DataCollector) + populate(objectMap, "description", k.Description) + populate(objectMap, "egressPublicNetworkAccess", k.EgressPublicNetworkAccess) + objectMap["endpointComputeType"] = EndpointComputeTypeKubernetes + populate(objectMap, "environmentId", k.EnvironmentID) + populate(objectMap, "environmentVariables", k.EnvironmentVariables) + populate(objectMap, "instanceType", k.InstanceType) + populate(objectMap, "livenessProbe", k.LivenessProbe) + populate(objectMap, "model", k.Model) + populate(objectMap, "modelMountPath", k.ModelMountPath) + populate(objectMap, "properties", k.Properties) + populate(objectMap, "provisioningState", k.ProvisioningState) + populate(objectMap, "readinessProbe", k.ReadinessProbe) + populate(objectMap, "requestSettings", k.RequestSettings) + populate(objectMap, "scaleSettings", k.ScaleSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesOnlineDeployment. +func (k *KubernetesOnlineDeployment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &k.AppInsightsEnabled) + delete(rawMsg, key) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &k.CodeConfiguration) + delete(rawMsg, key) + case "containerResourceRequirements": + err = unpopulate(val, "ContainerResourceRequirements", &k.ContainerResourceRequirements) + delete(rawMsg, key) + case "dataCollector": + err = unpopulate(val, "DataCollector", &k.DataCollector) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &k.Description) + delete(rawMsg, key) + case "egressPublicNetworkAccess": + err = unpopulate(val, "EgressPublicNetworkAccess", &k.EgressPublicNetworkAccess) + delete(rawMsg, key) + case "endpointComputeType": + err = unpopulate(val, "EndpointComputeType", &k.EndpointComputeType) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &k.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &k.EnvironmentVariables) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &k.InstanceType) + delete(rawMsg, key) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &k.LivenessProbe) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &k.Model) + delete(rawMsg, key) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &k.ModelMountPath) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &k.ReadinessProbe) + delete(rawMsg, key) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &k.RequestSettings) + delete(rawMsg, key) + case "scaleSettings": + k.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesProperties. +func (k KubernetesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultInstanceType", k.DefaultInstanceType) + populate(objectMap, "extensionInstanceReleaseTrain", k.ExtensionInstanceReleaseTrain) + populate(objectMap, "extensionPrincipalId", k.ExtensionPrincipalID) + populate(objectMap, "instanceTypes", k.InstanceTypes) + populate(objectMap, "namespace", k.Namespace) + populate(objectMap, "relayConnectionString", k.RelayConnectionString) + populate(objectMap, "serviceBusConnectionString", k.ServiceBusConnectionString) + populate(objectMap, "vcName", k.VcName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesProperties. +func (k *KubernetesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultInstanceType": + err = unpopulate(val, "DefaultInstanceType", &k.DefaultInstanceType) + delete(rawMsg, key) + case "extensionInstanceReleaseTrain": + err = unpopulate(val, "ExtensionInstanceReleaseTrain", &k.ExtensionInstanceReleaseTrain) + delete(rawMsg, key) + case "extensionPrincipalId": + err = unpopulate(val, "ExtensionPrincipalID", &k.ExtensionPrincipalID) + delete(rawMsg, key) + case "instanceTypes": + err = unpopulate(val, "InstanceTypes", &k.InstanceTypes) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &k.Namespace) + delete(rawMsg, key) + case "relayConnectionString": + err = unpopulate(val, "RelayConnectionString", &k.RelayConnectionString) + delete(rawMsg, key) + case "serviceBusConnectionString": + err = unpopulate(val, "ServiceBusConnectionString", &k.ServiceBusConnectionString) + delete(rawMsg, key) + case "vcName": + err = unpopulate(val, "VcName", &k.VcName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesSchema. +func (k KubernetesSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", k.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesSchema. +func (k *KubernetesSchema) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &k.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelCategory. +func (l LabelCategory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "classes", l.Classes) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "multiSelect", l.MultiSelect) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelCategory. +func (l *LabelCategory) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "classes": + err = unpopulate(val, "Classes", &l.Classes) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "multiSelect": + err = unpopulate(val, "MultiSelect", &l.MultiSelect) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelClass. +func (l LabelClass) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "subclasses", l.Subclasses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelClass. +func (l *LabelClass) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "subclasses": + err = unpopulate(val, "Subclasses", &l.Subclasses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingDataConfiguration. +func (l LabelingDataConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataId", l.DataID) + populate(objectMap, "incrementalDataRefresh", l.IncrementalDataRefresh) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingDataConfiguration. +func (l *LabelingDataConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataId": + err = unpopulate(val, "DataID", &l.DataID) + delete(rawMsg, key) + case "incrementalDataRefresh": + err = unpopulate(val, "IncrementalDataRefresh", &l.IncrementalDataRefresh) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJob. +func (l LabelingJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJob. +func (l *LabelingJob) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobImageProperties. +func (l LabelingJobImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotationType", l.AnnotationType) + objectMap["mediaType"] = MediaTypeImage + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobImageProperties. +func (l *LabelingJobImageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotationType": + err = unpopulate(val, "AnnotationType", &l.AnnotationType) + delete(rawMsg, key) + case "mediaType": + err = unpopulate(val, "MediaType", &l.MediaType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobInstructions. +func (l LabelingJobInstructions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "uri", l.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobInstructions. +func (l *LabelingJobInstructions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "uri": + err = unpopulate(val, "URI", &l.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobMediaProperties. +func (l LabelingJobMediaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["mediaType"] = l.MediaType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobMediaProperties. +func (l *LabelingJobMediaProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mediaType": + err = unpopulate(val, "MediaType", &l.MediaType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobProperties. +func (l LabelingJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "componentId", l.ComponentID) + populate(objectMap, "computeId", l.ComputeID) + populateDateTimeRFC3339(objectMap, "createdDateTime", l.CreatedDateTime) + populate(objectMap, "dataConfiguration", l.DataConfiguration) + populate(objectMap, "description", l.Description) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "experimentName", l.ExperimentName) + populate(objectMap, "identity", l.Identity) + populate(objectMap, "isArchived", l.IsArchived) + populate(objectMap, "jobInstructions", l.JobInstructions) + objectMap["jobType"] = JobTypeLabeling + populate(objectMap, "labelCategories", l.LabelCategories) + populate(objectMap, "labelingJobMediaProperties", l.LabelingJobMediaProperties) + populate(objectMap, "mlAssistConfiguration", l.MlAssistConfiguration) + populate(objectMap, "notificationSetting", l.NotificationSetting) + populate(objectMap, "progressMetrics", l.ProgressMetrics) + populate(objectMap, "projectId", l.ProjectID) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "secretsConfiguration", l.SecretsConfiguration) + populate(objectMap, "services", l.Services) + populate(objectMap, "status", l.Status) + populate(objectMap, "statusMessages", l.StatusMessages) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobProperties. +func (l *LabelingJobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "componentId": + err = unpopulate(val, "ComponentID", &l.ComponentID) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &l.ComputeID) + delete(rawMsg, key) + case "createdDateTime": + err = unpopulateDateTimeRFC3339(val, "CreatedDateTime", &l.CreatedDateTime) + delete(rawMsg, key) + case "dataConfiguration": + err = unpopulate(val, "DataConfiguration", &l.DataConfiguration) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &l.ExperimentName) + delete(rawMsg, key) + case "identity": + l.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &l.IsArchived) + delete(rawMsg, key) + case "jobInstructions": + err = unpopulate(val, "JobInstructions", &l.JobInstructions) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &l.JobType) + delete(rawMsg, key) + case "labelCategories": + err = unpopulate(val, "LabelCategories", &l.LabelCategories) + delete(rawMsg, key) + case "labelingJobMediaProperties": + l.LabelingJobMediaProperties, err = unmarshalLabelingJobMediaPropertiesClassification(val) + delete(rawMsg, key) + case "mlAssistConfiguration": + l.MlAssistConfiguration, err = unmarshalMLAssistConfigurationClassification(val) + delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &l.NotificationSetting) + delete(rawMsg, key) + case "progressMetrics": + err = unpopulate(val, "ProgressMetrics", &l.ProgressMetrics) + delete(rawMsg, key) + case "projectId": + err = unpopulate(val, "ProjectID", &l.ProjectID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &l.SecretsConfiguration) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &l.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + case "statusMessages": + err = unpopulate(val, "StatusMessages", &l.StatusMessages) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobResourceArmPaginatedResult. +func (l LabelingJobResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobResourceArmPaginatedResult. +func (l *LabelingJobResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobTextProperties. +func (l LabelingJobTextProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotationType", l.AnnotationType) + objectMap["mediaType"] = MediaTypeText + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobTextProperties. +func (l *LabelingJobTextProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotationType": + err = unpopulate(val, "AnnotationType", &l.AnnotationType) + delete(rawMsg, key) + case "mediaType": + err = unpopulate(val, "MediaType", &l.MediaType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LakeHouseArtifact. +func (l LakeHouseArtifact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactName", l.ArtifactName) + objectMap["artifactType"] = OneLakeArtifactTypeLakeHouse + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LakeHouseArtifact. +func (l *LakeHouseArtifact) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "artifactName": + err = unpopulate(val, "ArtifactName", &l.ArtifactName) + delete(rawMsg, key) + case "artifactType": + err = unpopulate(val, "ArtifactType", &l.ArtifactType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListAmlUserFeatureResult. +func (l ListAmlUserFeatureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListAmlUserFeatureResult. +func (l *ListAmlUserFeatureResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListNotebookKeysResult. +func (l ListNotebookKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primaryAccessKey", l.PrimaryAccessKey) + populate(objectMap, "secondaryAccessKey", l.SecondaryAccessKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListNotebookKeysResult. +func (l *ListNotebookKeysResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "primaryAccessKey": + err = unpopulate(val, "PrimaryAccessKey", &l.PrimaryAccessKey) + delete(rawMsg, key) + case "secondaryAccessKey": + err = unpopulate(val, "SecondaryAccessKey", &l.SecondaryAccessKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListStorageAccountKeysResult. +func (l ListStorageAccountKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "userStorageKey", l.UserStorageKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListStorageAccountKeysResult. +func (l *ListStorageAccountKeysResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "userStorageKey": + err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. +func (l ListUsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. +func (l *ListUsagesResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListWorkspaceKeysResult. +func (l ListWorkspaceKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appInsightsInstrumentationKey", l.AppInsightsInstrumentationKey) + populate(objectMap, "containerRegistryCredentials", l.ContainerRegistryCredentials) + populate(objectMap, "notebookAccessKeys", l.NotebookAccessKeys) + populate(objectMap, "userStorageArmId", l.UserStorageArmID) + populate(objectMap, "userStorageKey", l.UserStorageKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListWorkspaceKeysResult. +func (l *ListWorkspaceKeysResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appInsightsInstrumentationKey": + err = unpopulate(val, "AppInsightsInstrumentationKey", &l.AppInsightsInstrumentationKey) + delete(rawMsg, key) + case "containerRegistryCredentials": + err = unpopulate(val, "ContainerRegistryCredentials", &l.ContainerRegistryCredentials) + delete(rawMsg, key) + case "notebookAccessKeys": + err = unpopulate(val, "NotebookAccessKeys", &l.NotebookAccessKeys) + delete(rawMsg, key) + case "userStorageArmId": + err = unpopulate(val, "UserStorageArmID", &l.UserStorageArmID) + delete(rawMsg, key) + case "userStorageKey": + err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListWorkspaceQuotas. +func (l ListWorkspaceQuotas) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListWorkspaceQuotas. +func (l *ListWorkspaceQuotas) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiteralJobInput. +func (l LiteralJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", l.Description) + objectMap["jobInputType"] = JobInputTypeLiteral + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiteralJobInput. +func (l *LiteralJobInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &l.JobInputType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLAssistConfiguration. +func (m MLAssistConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["mlAssist"] = m.MlAssist + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLAssistConfiguration. +func (m *MLAssistConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mlAssist": + err = unpopulate(val, "MlAssist", &m.MlAssist) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLAssistConfigurationDisabled. +func (m MLAssistConfigurationDisabled) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["mlAssist"] = MLAssistConfigurationTypeDisabled + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLAssistConfigurationDisabled. +func (m *MLAssistConfigurationDisabled) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mlAssist": + err = unpopulate(val, "MlAssist", &m.MlAssist) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLAssistConfigurationEnabled. +func (m MLAssistConfigurationEnabled) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inferencingComputeBinding", m.InferencingComputeBinding) + objectMap["mlAssist"] = MLAssistConfigurationTypeEnabled + populate(objectMap, "trainingComputeBinding", m.TrainingComputeBinding) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLAssistConfigurationEnabled. +func (m *MLAssistConfigurationEnabled) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inferencingComputeBinding": + err = unpopulate(val, "InferencingComputeBinding", &m.InferencingComputeBinding) + delete(rawMsg, key) + case "mlAssist": + err = unpopulate(val, "MlAssist", &m.MlAssist) + delete(rawMsg, key) + case "trainingComputeBinding": + err = unpopulate(val, "TrainingComputeBinding", &m.TrainingComputeBinding) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLFlowModelJobInput. +func (m MLFlowModelJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", m.Description) + objectMap["jobInputType"] = JobInputTypeMlflowModel + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLFlowModelJobInput. +func (m *MLFlowModelJobInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &m.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLFlowModelJobOutput. +func (m MLFlowModelJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assetName", m.AssetName) + populate(objectMap, "assetVersion", m.AssetVersion) + populate(objectMap, "autoDeleteSetting", m.AutoDeleteSetting) + populate(objectMap, "description", m.Description) + objectMap["jobOutputType"] = JobOutputTypeMlflowModel + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLFlowModelJobOutput. +func (m *MLFlowModelJobOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assetName": + err = unpopulate(val, "AssetName", &m.AssetName) + delete(rawMsg, key) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &m.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &m.AutoDeleteSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &m.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLTableData. +func (m MLTableData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", m.AutoDeleteSetting) + objectMap["dataType"] = DataTypeMltable + populate(objectMap, "dataUri", m.DataURI) + populate(objectMap, "description", m.Description) + populate(objectMap, "intellectualProperty", m.IntellectualProperty) + populate(objectMap, "isAnonymous", m.IsAnonymous) + populate(objectMap, "isArchived", m.IsArchived) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "referencedUris", m.ReferencedUris) + populate(objectMap, "stage", m.Stage) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableData. +func (m *MLTableData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &m.AutoDeleteSetting) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &m.DataType) + delete(rawMsg, key) + case "dataUri": + err = unpopulate(val, "DataURI", &m.DataURI) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &m.IntellectualProperty) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &m.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &m.IsArchived) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "referencedUris": + err = unpopulate(val, "ReferencedUris", &m.ReferencedUris) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLTableJobInput. +func (m MLTableJobInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", m.Description) + objectMap["jobInputType"] = JobInputTypeMltable + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableJobInput. +func (m *MLTableJobInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &m.JobInputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLTableJobOutput. +func (m MLTableJobOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assetName", m.AssetName) + populate(objectMap, "assetVersion", m.AssetVersion) + populate(objectMap, "autoDeleteSetting", m.AutoDeleteSetting) + populate(objectMap, "description", m.Description) + objectMap["jobOutputType"] = JobOutputTypeMltable + populate(objectMap, "mode", m.Mode) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableJobOutput. +func (m *MLTableJobOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assetName": + err = unpopulate(val, "AssetName", &m.AssetName) + delete(rawMsg, key) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &m.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &m.AutoDeleteSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "jobOutputType": + err = unpopulate(val, "JobOutputType", &m.JobOutputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedComputeIdentity. +func (m ManagedComputeIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["computeIdentityType"] = MonitorComputeIdentityTypeManagedIdentity + populate(objectMap, "identity", m.Identity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedComputeIdentity. +func (m *ManagedComputeIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeIdentityType": + err = unpopulate(val, "ComputeIdentityType", &m.ComputeIdentityType) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedIdentity. +func (m ManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", m.ClientID) + objectMap["identityType"] = IdentityConfigurationTypeManaged + populate(objectMap, "objectId", m.ObjectID) + populate(objectMap, "resourceId", m.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentity. +func (m *ManagedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &m.ClientID) + delete(rawMsg, key) + case "identityType": + err = unpopulate(val, "IdentityType", &m.IdentityType) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, "ObjectID", &m.ObjectID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &m.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. +func (m ManagedIdentityAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = ConnectionAuthTypeManagedIdentity + populate(objectMap, "category", m.Category) + populate(objectMap, "createdByWorkspaceArmId", m.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", m.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", m.ExpiryTime) + populate(objectMap, "isSharedToAll", m.IsSharedToAll) + populateAny(objectMap, "metadata", m.Metadata) + populate(objectMap, "target", m.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. +func (m *ManagedIdentityAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authType": + err = unpopulate(val, "AuthType", &m.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &m.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &m.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &m.ExpiryTime) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &m.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &m.Metadata) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &m.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedIdentityCredential. +func (m ManagedIdentityCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["credentialType"] = DataReferenceCredentialTypeManagedIdentity + populate(objectMap, "managedIdentityType", m.ManagedIdentityType) + populate(objectMap, "userManagedIdentityClientId", m.UserManagedIdentityClientID) + populate(objectMap, "userManagedIdentityPrincipalId", m.UserManagedIdentityPrincipalID) + populate(objectMap, "userManagedIdentityResourceId", m.UserManagedIdentityResourceID) + populate(objectMap, "userManagedIdentityTenantId", m.UserManagedIdentityTenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityCredential. +func (m *ManagedIdentityCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentialType": + err = unpopulate(val, "CredentialType", &m.CredentialType) + delete(rawMsg, key) + case "managedIdentityType": + err = unpopulate(val, "ManagedIdentityType", &m.ManagedIdentityType) + delete(rawMsg, key) + case "userManagedIdentityClientId": + err = unpopulate(val, "UserManagedIdentityClientID", &m.UserManagedIdentityClientID) + delete(rawMsg, key) + case "userManagedIdentityPrincipalId": + err = unpopulate(val, "UserManagedIdentityPrincipalID", &m.UserManagedIdentityPrincipalID) + delete(rawMsg, key) + case "userManagedIdentityResourceId": + err = unpopulate(val, "UserManagedIdentityResourceID", &m.UserManagedIdentityResourceID) + delete(rawMsg, key) + case "userManagedIdentityTenantId": + err = unpopulate(val, "UserManagedIdentityTenantID", &m.UserManagedIdentityTenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedNetworkProvisionOptions. +func (m ManagedNetworkProvisionOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "includeSpark", m.IncludeSpark) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedNetworkProvisionOptions. +func (m *ManagedNetworkProvisionOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "includeSpark": + err = unpopulate(val, "IncludeSpark", &m.IncludeSpark) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedNetworkProvisionStatus. +func (m ManagedNetworkProvisionStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sparkReady", m.SparkReady) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedNetworkProvisionStatus. +func (m *ManagedNetworkProvisionStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sparkReady": + err = unpopulate(val, "SparkReady", &m.SparkReady) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedNetworkSettings. +func (m ManagedNetworkSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "changeableIsolationModes", m.ChangeableIsolationModes) + populate(objectMap, "isolationMode", m.IsolationMode) + populate(objectMap, "networkId", m.NetworkID) + populate(objectMap, "outboundRules", m.OutboundRules) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedNetworkSettings. +func (m *ManagedNetworkSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "changeableIsolationModes": + err = unpopulate(val, "ChangeableIsolationModes", &m.ChangeableIsolationModes) + delete(rawMsg, key) + case "isolationMode": + err = unpopulate(val, "IsolationMode", &m.IsolationMode) + delete(rawMsg, key) + case "networkId": + err = unpopulate(val, "NetworkID", &m.NetworkID) + delete(rawMsg, key) + case "outboundRules": + m.OutboundRules, err = unmarshalOutboundRuleClassificationMap(val) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedOnlineDeployment. +func (m ManagedOnlineDeployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appInsightsEnabled", m.AppInsightsEnabled) + populate(objectMap, "codeConfiguration", m.CodeConfiguration) + populate(objectMap, "dataCollector", m.DataCollector) + populate(objectMap, "description", m.Description) + populate(objectMap, "egressPublicNetworkAccess", m.EgressPublicNetworkAccess) + objectMap["endpointComputeType"] = EndpointComputeTypeManaged + populate(objectMap, "environmentId", m.EnvironmentID) + populate(objectMap, "environmentVariables", m.EnvironmentVariables) + populate(objectMap, "instanceType", m.InstanceType) + populate(objectMap, "livenessProbe", m.LivenessProbe) + populate(objectMap, "model", m.Model) + populate(objectMap, "modelMountPath", m.ModelMountPath) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "readinessProbe", m.ReadinessProbe) + populate(objectMap, "requestSettings", m.RequestSettings) + populate(objectMap, "scaleSettings", m.ScaleSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedOnlineDeployment. +func (m *ManagedOnlineDeployment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &m.AppInsightsEnabled) + delete(rawMsg, key) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &m.CodeConfiguration) + delete(rawMsg, key) + case "dataCollector": + err = unpopulate(val, "DataCollector", &m.DataCollector) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "egressPublicNetworkAccess": + err = unpopulate(val, "EgressPublicNetworkAccess", &m.EgressPublicNetworkAccess) + delete(rawMsg, key) + case "endpointComputeType": + err = unpopulate(val, "EndpointComputeType", &m.EndpointComputeType) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &m.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &m.EnvironmentVariables) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &m.InstanceType) + delete(rawMsg, key) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &m.LivenessProbe) + delete(rawMsg, key) + case "model": + err = unpopulate(val, "Model", &m.Model) + delete(rawMsg, key) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &m.ModelMountPath) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &m.ReadinessProbe) + delete(rawMsg, key) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &m.RequestSettings) + delete(rawMsg, key) + case "scaleSettings": + m.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaterializationComputeResource. +func (m MaterializationComputeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instanceType", m.InstanceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializationComputeResource. +func (m *MaterializationComputeResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceType": + err = unpopulate(val, "InstanceType", &m.InstanceType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaterializationSettings. +func (m MaterializationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "notification", m.Notification) + populate(objectMap, "resource", m.Resource) + populate(objectMap, "schedule", m.Schedule) + populate(objectMap, "sparkConfiguration", m.SparkConfiguration) + populate(objectMap, "storeType", m.StoreType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializationSettings. +func (m *MaterializationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "notification": + err = unpopulate(val, "Notification", &m.Notification) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &m.Resource) + delete(rawMsg, key) + case "schedule": + err = unpopulate(val, "Schedule", &m.Schedule) + delete(rawMsg, key) + case "sparkConfiguration": + err = unpopulate(val, "SparkConfiguration", &m.SparkConfiguration) + delete(rawMsg, key) + case "storeType": + err = unpopulate(val, "StoreType", &m.StoreType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MedianStoppingPolicy. +func (m MedianStoppingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "delayEvaluation", m.DelayEvaluation) + populate(objectMap, "evaluationInterval", m.EvaluationInterval) + objectMap["policyType"] = EarlyTerminationPolicyTypeMedianStopping + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MedianStoppingPolicy. +func (m *MedianStoppingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "delayEvaluation": + err = unpopulate(val, "DelayEvaluation", &m.DelayEvaluation) + delete(rawMsg, key) + case "evaluationInterval": + err = unpopulate(val, "EvaluationInterval", &m.EvaluationInterval) + delete(rawMsg, key) + case "policyType": + err = unpopulate(val, "PolicyType", &m.PolicyType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelConfiguration. +func (m ModelConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mode", m.Mode) + populate(objectMap, "mountPath", m.MountPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelConfiguration. +func (m *ModelConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &m.MountPath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelContainer. +func (m ModelContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelContainer. +func (m *ModelContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelContainerProperties. +func (m ModelContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", m.Description) + populate(objectMap, "isArchived", m.IsArchived) + populate(objectMap, "latestVersion", m.LatestVersion) + populate(objectMap, "nextVersion", m.NextVersion) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelContainerProperties. +func (m *ModelContainerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &m.IsArchived) + delete(rawMsg, key) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &m.LatestVersion) + delete(rawMsg, key) + case "nextVersion": + err = unpopulate(val, "NextVersion", &m.NextVersion) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelContainerResourceArmPaginatedResult. +func (m ModelContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelContainerResourceArmPaginatedResult. +func (m *ModelContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelPackageInput. +func (m ModelPackageInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inputType", m.InputType) + populate(objectMap, "mode", m.Mode) + populate(objectMap, "mountPath", m.MountPath) + populate(objectMap, "path", m.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelPackageInput. +func (m *ModelPackageInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inputType": + err = unpopulate(val, "InputType", &m.InputType) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &m.MountPath) + delete(rawMsg, key) + case "path": + m.Path, err = unmarshalPackageInputPathBaseClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelPerformanceMetricThresholdBase. +func (m ModelPerformanceMetricThresholdBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["modelType"] = m.ModelType + populate(objectMap, "threshold", m.Threshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelPerformanceMetricThresholdBase. +func (m *ModelPerformanceMetricThresholdBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "modelType": + err = unpopulate(val, "ModelType", &m.ModelType) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &m.Threshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelPerformanceSignal. +func (m ModelPerformanceSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataSegment", m.DataSegment) + populate(objectMap, "metricThreshold", m.MetricThreshold) + populate(objectMap, "notificationTypes", m.NotificationTypes) + populate(objectMap, "productionData", m.ProductionData) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "referenceData", m.ReferenceData) + objectMap["signalType"] = MonitoringSignalTypeModelPerformance + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelPerformanceSignal. +func (m *ModelPerformanceSignal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataSegment": + err = unpopulate(val, "DataSegment", &m.DataSegment) + delete(rawMsg, key) + case "metricThreshold": + m.MetricThreshold, err = unmarshalModelPerformanceMetricThresholdBaseClassification(val) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &m.NotificationTypes) + delete(rawMsg, key) + case "productionData": + m.ProductionData, err = unmarshalMonitoringInputDataBaseClassificationArray(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "referenceData": + m.ReferenceData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &m.SignalType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelVersion. +func (m ModelVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelVersion. +func (m *ModelVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelVersionProperties. +func (m ModelVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", m.AutoDeleteSetting) + populate(objectMap, "description", m.Description) + populate(objectMap, "flavors", m.Flavors) + populate(objectMap, "intellectualProperty", m.IntellectualProperty) + populate(objectMap, "isAnonymous", m.IsAnonymous) + populate(objectMap, "isArchived", m.IsArchived) + populate(objectMap, "jobName", m.JobName) + populate(objectMap, "modelType", m.ModelType) + populate(objectMap, "modelUri", m.ModelURI) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "stage", m.Stage) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelVersionProperties. +func (m *ModelVersionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &m.AutoDeleteSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "flavors": + err = unpopulate(val, "Flavors", &m.Flavors) + delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &m.IntellectualProperty) + delete(rawMsg, key) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &m.IsAnonymous) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &m.IsArchived) + delete(rawMsg, key) + case "jobName": + err = unpopulate(val, "JobName", &m.JobName) + delete(rawMsg, key) + case "modelType": + err = unpopulate(val, "ModelType", &m.ModelType) + delete(rawMsg, key) + case "modelUri": + err = unpopulate(val, "ModelURI", &m.ModelURI) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &m.Stage) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ModelVersionResourceArmPaginatedResult. +func (m ModelVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelVersionResourceArmPaginatedResult. +func (m *ModelVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitorComputeConfigurationBase. +func (m MonitorComputeConfigurationBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["computeType"] = m.ComputeType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorComputeConfigurationBase. +func (m *MonitorComputeConfigurationBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeType": + err = unpopulate(val, "ComputeType", &m.ComputeType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitorComputeIdentityBase. +func (m MonitorComputeIdentityBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["computeIdentityType"] = m.ComputeIdentityType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorComputeIdentityBase. +func (m *MonitorComputeIdentityBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeIdentityType": + err = unpopulate(val, "ComputeIdentityType", &m.ComputeIdentityType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitorDefinition. +func (m MonitorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alertNotificationSettings", m.AlertNotificationSettings) + populate(objectMap, "computeConfiguration", m.ComputeConfiguration) + populate(objectMap, "monitoringTarget", m.MonitoringTarget) + populate(objectMap, "signals", m.Signals) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorDefinition. +func (m *MonitorDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertNotificationSettings": + err = unpopulate(val, "AlertNotificationSettings", &m.AlertNotificationSettings) + delete(rawMsg, key) + case "computeConfiguration": + m.ComputeConfiguration, err = unmarshalMonitorComputeConfigurationBaseClassification(val) + delete(rawMsg, key) + case "monitoringTarget": + err = unpopulate(val, "MonitoringTarget", &m.MonitoringTarget) + delete(rawMsg, key) + case "signals": + m.Signals, err = unmarshalMonitoringSignalBaseClassificationMap(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitorEmailNotificationSettings. +func (m MonitorEmailNotificationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "emails", m.Emails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorEmailNotificationSettings. +func (m *MonitorEmailNotificationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "emails": + err = unpopulate(val, "Emails", &m.Emails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitorNotificationSettings. +func (m MonitorNotificationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "emailNotificationSettings", m.EmailNotificationSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorNotificationSettings. +func (m *MonitorNotificationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "emailNotificationSettings": + err = unpopulate(val, "EmailNotificationSettings", &m.EmailNotificationSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitorServerlessSparkCompute. +func (m MonitorServerlessSparkCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeIdentity", m.ComputeIdentity) + objectMap["computeType"] = MonitorComputeTypeServerlessSpark + populate(objectMap, "instanceType", m.InstanceType) + populate(objectMap, "runtimeVersion", m.RuntimeVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorServerlessSparkCompute. +func (m *MonitorServerlessSparkCompute) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "computeIdentity": + m.ComputeIdentity, err = unmarshalMonitorComputeIdentityBaseClassification(val) + delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &m.ComputeType) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &m.InstanceType) + delete(rawMsg, key) + case "runtimeVersion": + err = unpopulate(val, "RuntimeVersion", &m.RuntimeVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringDataSegment. +func (m MonitoringDataSegment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "feature", m.Feature) + populate(objectMap, "values", m.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringDataSegment. +func (m *MonitoringDataSegment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "feature": + err = unpopulate(val, "Feature", &m.Feature) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &m.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringFeatureFilterBase. +func (m MonitoringFeatureFilterBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["filterType"] = m.FilterType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringFeatureFilterBase. +func (m *MonitoringFeatureFilterBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "filterType": + err = unpopulate(val, "FilterType", &m.FilterType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringInputDataBase. +func (m MonitoringInputDataBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columns", m.Columns) + populate(objectMap, "dataContext", m.DataContext) + objectMap["inputDataType"] = m.InputDataType + populate(objectMap, "jobInputType", m.JobInputType) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringInputDataBase. +func (m *MonitoringInputDataBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "columns": + err = unpopulate(val, "Columns", &m.Columns) + delete(rawMsg, key) + case "dataContext": + err = unpopulate(val, "DataContext", &m.DataContext) + delete(rawMsg, key) + case "inputDataType": + err = unpopulate(val, "InputDataType", &m.InputDataType) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &m.JobInputType) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringSignalBase. +func (m MonitoringSignalBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "notificationTypes", m.NotificationTypes) + populate(objectMap, "properties", m.Properties) + objectMap["signalType"] = m.SignalType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringSignalBase. +func (m *MonitoringSignalBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &m.NotificationTypes) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &m.SignalType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringTarget. +func (m MonitoringTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deploymentId", m.DeploymentID) + populate(objectMap, "modelId", m.ModelID) + populate(objectMap, "taskType", m.TaskType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringTarget. +func (m *MonitoringTarget) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentId": + err = unpopulate(val, "DeploymentID", &m.DeploymentID) + delete(rawMsg, key) + case "modelId": + err = unpopulate(val, "ModelID", &m.ModelID) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &m.TaskType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringThreshold. +func (m MonitoringThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringThreshold. +func (m *MonitoringThreshold) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonitoringWorkspaceConnection. +func (m MonitoringWorkspaceConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "environmentVariables", m.EnvironmentVariables) + populate(objectMap, "secrets", m.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringWorkspaceConnection. +func (m *MonitoringWorkspaceConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &m.EnvironmentVariables) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &m.Secrets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Mpi. +func (m Mpi) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["distributionType"] = DistributionTypeMpi + populate(objectMap, "processCountPerInstance", m.ProcessCountPerInstance) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Mpi. +func (m *Mpi) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "distributionType": + err = unpopulate(val, "DistributionType", &m.DistributionType) + delete(rawMsg, key) + case "processCountPerInstance": + err = unpopulate(val, "ProcessCountPerInstance", &m.ProcessCountPerInstance) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NCrossValidations. +func (n NCrossValidations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["mode"] = n.Mode + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NCrossValidations. +func (n *NCrossValidations) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mode": + err = unpopulate(val, "Mode", &n.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NlpFixedParameters. +func (n NlpFixedParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gradientAccumulationSteps", n.GradientAccumulationSteps) + populate(objectMap, "learningRate", n.LearningRate) + populate(objectMap, "learningRateScheduler", n.LearningRateScheduler) + populate(objectMap, "modelName", n.ModelName) + populate(objectMap, "numberOfEpochs", n.NumberOfEpochs) + populate(objectMap, "trainingBatchSize", n.TrainingBatchSize) + populate(objectMap, "validationBatchSize", n.ValidationBatchSize) + populate(objectMap, "warmupRatio", n.WarmupRatio) + populate(objectMap, "weightDecay", n.WeightDecay) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NlpFixedParameters. +func (n *NlpFixedParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gradientAccumulationSteps": + err = unpopulate(val, "GradientAccumulationSteps", &n.GradientAccumulationSteps) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &n.LearningRate) + delete(rawMsg, key) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &n.LearningRateScheduler) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &n.ModelName) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &n.NumberOfEpochs) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &n.TrainingBatchSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &n.ValidationBatchSize) + delete(rawMsg, key) + case "warmupRatio": + err = unpopulate(val, "WarmupRatio", &n.WarmupRatio) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &n.WeightDecay) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NlpParameterSubspace. +func (n NlpParameterSubspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gradientAccumulationSteps", n.GradientAccumulationSteps) + populate(objectMap, "learningRate", n.LearningRate) + populate(objectMap, "learningRateScheduler", n.LearningRateScheduler) + populate(objectMap, "modelName", n.ModelName) + populate(objectMap, "numberOfEpochs", n.NumberOfEpochs) + populate(objectMap, "trainingBatchSize", n.TrainingBatchSize) + populate(objectMap, "validationBatchSize", n.ValidationBatchSize) + populate(objectMap, "warmupRatio", n.WarmupRatio) + populate(objectMap, "weightDecay", n.WeightDecay) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NlpParameterSubspace. +func (n *NlpParameterSubspace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gradientAccumulationSteps": + err = unpopulate(val, "GradientAccumulationSteps", &n.GradientAccumulationSteps) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &n.LearningRate) delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + case "learningRateScheduler": + err = unpopulate(val, "LearningRateScheduler", &n.LearningRateScheduler) delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + case "modelName": + err = unpopulate(val, "ModelName", &n.ModelName) + delete(rawMsg, key) + case "numberOfEpochs": + err = unpopulate(val, "NumberOfEpochs", &n.NumberOfEpochs) + delete(rawMsg, key) + case "trainingBatchSize": + err = unpopulate(val, "TrainingBatchSize", &n.TrainingBatchSize) + delete(rawMsg, key) + case "validationBatchSize": + err = unpopulate(val, "ValidationBatchSize", &n.ValidationBatchSize) + delete(rawMsg, key) + case "warmupRatio": + err = unpopulate(val, "WarmupRatio", &n.WarmupRatio) + delete(rawMsg, key) + case "weightDecay": + err = unpopulate(val, "WeightDecay", &n.WeightDecay) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NlpSweepSettings. +func (n NlpSweepSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "earlyTermination", n.EarlyTermination) + populate(objectMap, "samplingAlgorithm", n.SamplingAlgorithm) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NlpSweepSettings. +func (n *NlpSweepSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "earlyTermination": + n.EarlyTermination, err = unmarshalEarlyTerminationPolicyClassification(val) + delete(rawMsg, key) + case "samplingAlgorithm": + err = unpopulate(val, "SamplingAlgorithm", &n.SamplingAlgorithm) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NlpVertical. +func (n NlpVertical) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "featurizationSettings", n.FeaturizationSettings) + populate(objectMap, "fixedParameters", n.FixedParameters) + populate(objectMap, "limitSettings", n.LimitSettings) + populate(objectMap, "searchSpace", n.SearchSpace) + populate(objectMap, "sweepSettings", n.SweepSettings) + populate(objectMap, "validationData", n.ValidationData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NlpVertical. +func (n *NlpVertical) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "featurizationSettings": + err = unpopulate(val, "FeaturizationSettings", &n.FeaturizationSettings) + delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &n.FixedParameters) + delete(rawMsg, key) + case "limitSettings": + err = unpopulate(val, "LimitSettings", &n.LimitSettings) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &n.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &n.SweepSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &n.ValidationData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NlpVerticalFeaturizationSettings. +func (n NlpVerticalFeaturizationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "datasetLanguage", n.DatasetLanguage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NlpVerticalFeaturizationSettings. +func (n *NlpVerticalFeaturizationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "datasetLanguage": + err = unpopulate(val, "DatasetLanguage", &n.DatasetLanguage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NlpVerticalLimitSettings. +func (n NlpVerticalLimitSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxConcurrentTrials", n.MaxConcurrentTrials) + populate(objectMap, "maxNodes", n.MaxNodes) + populate(objectMap, "maxTrials", n.MaxTrials) + populate(objectMap, "timeout", n.Timeout) + populate(objectMap, "trialTimeout", n.TrialTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NlpVerticalLimitSettings. +func (n *NlpVerticalLimitSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxConcurrentTrials": + err = unpopulate(val, "MaxConcurrentTrials", &n.MaxConcurrentTrials) + delete(rawMsg, key) + case "maxNodes": + err = unpopulate(val, "MaxNodes", &n.MaxNodes) + delete(rawMsg, key) + case "maxTrials": + err = unpopulate(val, "MaxTrials", &n.MaxTrials) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &n.Timeout) + delete(rawMsg, key) + case "trialTimeout": + err = unpopulate(val, "TrialTimeout", &n.TrialTimeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NodeStateCounts. +func (n NodeStateCounts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "idleNodeCount", n.IdleNodeCount) + populate(objectMap, "leavingNodeCount", n.LeavingNodeCount) + populate(objectMap, "preemptedNodeCount", n.PreemptedNodeCount) + populate(objectMap, "preparingNodeCount", n.PreparingNodeCount) + populate(objectMap, "runningNodeCount", n.RunningNodeCount) + populate(objectMap, "unusableNodeCount", n.UnusableNodeCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeStateCounts. +func (n *NodeStateCounts) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "idleNodeCount": + err = unpopulate(val, "IdleNodeCount", &n.IdleNodeCount) + delete(rawMsg, key) + case "leavingNodeCount": + err = unpopulate(val, "LeavingNodeCount", &n.LeavingNodeCount) + delete(rawMsg, key) + case "preemptedNodeCount": + err = unpopulate(val, "PreemptedNodeCount", &n.PreemptedNodeCount) + delete(rawMsg, key) + case "preparingNodeCount": + err = unpopulate(val, "PreparingNodeCount", &n.PreparingNodeCount) + delete(rawMsg, key) + case "runningNodeCount": + err = unpopulate(val, "RunningNodeCount", &n.RunningNodeCount) + delete(rawMsg, key) + case "unusableNodeCount": + err = unpopulate(val, "UnusableNodeCount", &n.UnusableNodeCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Nodes. +func (n Nodes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["nodesValueType"] = n.NodesValueType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Nodes. +func (n *Nodes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nodesValueType": + err = unpopulate(val, "NodesValueType", &n.NodesValueType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NoneAuthTypeWorkspaceConnectionProperties. +func (n NoneAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = ConnectionAuthTypeNone + populate(objectMap, "category", n.Category) + populate(objectMap, "createdByWorkspaceArmId", n.CreatedByWorkspaceArmID) + populateDateTimeRFC3339(objectMap, "expiryTime", n.ExpiryTime) + populate(objectMap, "isSharedToAll", n.IsSharedToAll) + populateAny(objectMap, "metadata", n.Metadata) + populate(objectMap, "target", n.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NoneAuthTypeWorkspaceConnectionProperties. +func (n *NoneAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authType": + err = unpopulate(val, "AuthType", &n.AuthType) delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + case "category": + err = unpopulate(val, "Category", &n.Category) delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &n.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "imageSize": - err = unpopulate(val, "ImageSize", &i.ImageSize) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &n.ExpiryTime) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &n.IsSharedToAll) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "metadata": + err = unpopulate(val, "Metadata", &n.Metadata) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + case "target": + err = unpopulate(val, "Target", &n.Target) delete(rawMsg, key) - case "maxSize": - err = unpopulate(val, "MaxSize", &i.MaxSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NoneDatastoreCredentials. +func (n NoneDatastoreCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["credentialsType"] = CredentialsTypeNone + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NoneDatastoreCredentials. +func (n *NoneDatastoreCredentials) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentialsType": + err = unpopulate(val, "CredentialsType", &n.CredentialsType) delete(rawMsg, key) - case "minSize": - err = unpopulate(val, "MinSize", &i.MinSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotebookAccessTokenResult. +func (n NotebookAccessTokenResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessToken", n.AccessToken) + populate(objectMap, "expiresIn", n.ExpiresIn) + populate(objectMap, "hostName", n.HostName) + populate(objectMap, "notebookResourceId", n.NotebookResourceID) + populate(objectMap, "publicDns", n.PublicDNS) + populate(objectMap, "refreshToken", n.RefreshToken) + populate(objectMap, "scope", n.Scope) + populate(objectMap, "tokenType", n.TokenType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookAccessTokenResult. +func (n *NotebookAccessTokenResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessToken": + err = unpopulate(val, "AccessToken", &n.AccessToken) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "expiresIn": + err = unpopulate(val, "ExpiresIn", &n.ExpiresIn) delete(rawMsg, key) - case "modelSize": - err = unpopulate(val, "ModelSize", &i.ModelSize) + case "hostName": + err = unpopulate(val, "HostName", &n.HostName) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + case "notebookResourceId": + err = unpopulate(val, "NotebookResourceID", &n.NotebookResourceID) delete(rawMsg, key) - case "multiScale": - err = unpopulate(val, "MultiScale", &i.MultiScale) + case "publicDns": + err = unpopulate(val, "PublicDNS", &n.PublicDNS) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + case "refreshToken": + err = unpopulate(val, "RefreshToken", &n.RefreshToken) delete(rawMsg, key) - case "nmsIouThreshold": - err = unpopulate(val, "NmsIouThreshold", &i.NmsIouThreshold) + case "scope": + err = unpopulate(val, "Scope", &n.Scope) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "tokenType": + err = unpopulate(val, "TokenType", &n.TokenType) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotebookPreparationError. +func (n NotebookPreparationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", n.ErrorMessage) + populate(objectMap, "statusCode", n.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookPreparationError. +func (n *NotebookPreparationError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &n.ErrorMessage) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "statusCode": + err = unpopulate(val, "StatusCode", &n.StatusCode) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotebookResourceInfo. +func (n NotebookResourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", n.Fqdn) + populate(objectMap, "isPrivateLinkEnabled", n.IsPrivateLinkEnabled) + populate(objectMap, "notebookPreparationError", n.NotebookPreparationError) + populate(objectMap, "resourceId", n.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookResourceInfo. +func (n *NotebookResourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fqdn": + err = unpopulate(val, "Fqdn", &n.Fqdn) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "isPrivateLinkEnabled": + err = unpopulate(val, "IsPrivateLinkEnabled", &n.IsPrivateLinkEnabled) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "notebookPreparationError": + err = unpopulate(val, "NotebookPreparationError", &n.NotebookPreparationError) delete(rawMsg, key) - case "tileGridSize": - err = unpopulate(val, "TileGridSize", &i.TileGridSize) + case "resourceId": + err = unpopulate(val, "ResourceID", &n.ResourceID) delete(rawMsg, key) - case "tileOverlapRatio": - err = unpopulate(val, "TileOverlapRatio", &i.TileOverlapRatio) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotificationSetting. +func (n NotificationSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "emailOn", n.EmailOn) + populate(objectMap, "emails", n.Emails) + populate(objectMap, "webhooks", n.Webhooks) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationSetting. +func (n *NotificationSetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "emailOn": + err = unpopulate(val, "EmailOn", &n.EmailOn) delete(rawMsg, key) - case "tilePredictionsNmsThreshold": - err = unpopulate(val, "TilePredictionsNmsThreshold", &i.TilePredictionsNmsThreshold) + case "emails": + err = unpopulate(val, "Emails", &n.Emails) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "webhooks": + n.Webhooks, err = unmarshalWebhookClassificationMap(val) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NumericalDataDriftMetricThreshold. +func (n NumericalDataDriftMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["dataType"] = MonitoringFeatureDataTypeNumerical + populate(objectMap, "metric", n.Metric) + populate(objectMap, "threshold", n.Threshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumericalDataDriftMetricThreshold. +func (n *NumericalDataDriftMetricThreshold) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &n.DataType) delete(rawMsg, key) - case "validationIouThreshold": - err = unpopulate(val, "ValidationIouThreshold", &i.ValidationIouThreshold) + case "metric": + err = unpopulate(val, "Metric", &n.Metric) delete(rawMsg, key) - case "validationMetricType": - err = unpopulate(val, "ValidationMetricType", &i.ValidationMetricType) + case "threshold": + err = unpopulate(val, "Threshold", &n.Threshold) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NumericalDataQualityMetricThreshold. +func (n NumericalDataQualityMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["dataType"] = MonitoringFeatureDataTypeNumerical + populate(objectMap, "metric", n.Metric) + populate(objectMap, "threshold", n.Threshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NumericalDataQualityMetricThreshold. +func (n *NumericalDataQualityMetricThreshold) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &n.DataType) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "metric": + err = unpopulate(val, "Metric", &n.Metric) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "threshold": + err = unpopulate(val, "Threshold", &n.Threshold) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageModelSettings. -func (i ImageModelSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NumericalPredictionDriftMetricThreshold. +func (n NumericalPredictionDriftMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "advancedSettings", i.AdvancedSettings) - populate(objectMap, "amsGradient", i.AmsGradient) - populate(objectMap, "augmentations", i.Augmentations) - populate(objectMap, "beta1", i.Beta1) - populate(objectMap, "beta2", i.Beta2) - populate(objectMap, "checkpointFrequency", i.CheckpointFrequency) - populate(objectMap, "checkpointModel", i.CheckpointModel) - populate(objectMap, "checkpointRunId", i.CheckpointRunID) - populate(objectMap, "distributed", i.Distributed) - populate(objectMap, "earlyStopping", i.EarlyStopping) - populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) - populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) - populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) - populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) - populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) - populate(objectMap, "layersToFreeze", i.LayersToFreeze) - populate(objectMap, "learningRate", i.LearningRate) - populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) - populate(objectMap, "modelName", i.ModelName) - populate(objectMap, "momentum", i.Momentum) - populate(objectMap, "nesterov", i.Nesterov) - populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) - populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) - populate(objectMap, "optimizer", i.Optimizer) - populate(objectMap, "randomSeed", i.RandomSeed) - populate(objectMap, "stepLRGamma", i.StepLRGamma) - populate(objectMap, "stepLRStepSize", i.StepLRStepSize) - populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) - populate(objectMap, "validationBatchSize", i.ValidationBatchSize) - populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) - populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) - populate(objectMap, "weightDecay", i.WeightDecay) + objectMap["dataType"] = MonitoringFeatureDataTypeNumerical + populate(objectMap, "metric", n.Metric) + populate(objectMap, "threshold", n.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelSettings. -func (i *ImageModelSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NumericalPredictionDriftMetricThreshold. +func (n *NumericalPredictionDriftMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "advancedSettings": - err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) - delete(rawMsg, key) - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) - delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) - delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) - delete(rawMsg, key) - case "beta2": - err = unpopulate(val, "Beta2", &i.Beta2) - delete(rawMsg, key) - case "checkpointFrequency": - err = unpopulate(val, "CheckpointFrequency", &i.CheckpointFrequency) - delete(rawMsg, key) - case "checkpointModel": - err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) - delete(rawMsg, key) - case "checkpointRunId": - err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) - delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) - delete(rawMsg, key) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) - delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) - delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) - delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) - delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) - delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "dataType": + err = unpopulate(val, "DataType", &n.DataType) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "metric": + err = unpopulate(val, "Metric", &n.Metric) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "threshold": + err = unpopulate(val, "Threshold", &n.Threshold) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Objective. +func (o Objective) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "goal", o.Goal) + populate(objectMap, "primaryMetric", o.PrimaryMetric) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Objective. +func (o *Objective) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "goal": + err = unpopulate(val, "Goal", &o.Goal) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &o.PrimaryMetric) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OneLakeArtifact. +func (o OneLakeArtifact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactName", o.ArtifactName) + objectMap["artifactType"] = o.ArtifactType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OneLakeArtifact. +func (o *OneLakeArtifact) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "artifactName": + err = unpopulate(val, "ArtifactName", &o.ArtifactName) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + case "artifactType": + err = unpopulate(val, "ArtifactType", &o.ArtifactType) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OneLakeDatastore. +func (o OneLakeDatastore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifact", o.Artifact) + populate(objectMap, "credentials", o.Credentials) + objectMap["datastoreType"] = DatastoreTypeOneLake + populate(objectMap, "description", o.Description) + populate(objectMap, "endpoint", o.Endpoint) + populate(objectMap, "intellectualProperty", o.IntellectualProperty) + populate(objectMap, "isDefault", o.IsDefault) + populate(objectMap, "oneLakeWorkspaceName", o.OneLakeWorkspaceName) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "serviceDataAccessAuthIdentity", o.ServiceDataAccessAuthIdentity) + populate(objectMap, "tags", o.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OneLakeDatastore. +func (o *OneLakeDatastore) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "artifact": + o.Artifact, err = unmarshalOneLakeArtifactClassification(val) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "credentials": + o.Credentials, err = unmarshalDatastoreCredentialsClassification(val) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &o.DatastoreType) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "endpoint": + err = unpopulate(val, "Endpoint", &o.Endpoint) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &o.IntellectualProperty) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "isDefault": + err = unpopulate(val, "IsDefault", &o.IsDefault) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "oneLakeWorkspaceName": + err = unpopulate(val, "OneLakeWorkspaceName", &o.OneLakeWorkspaceName) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "serviceDataAccessAuthIdentity": + err = unpopulate(val, "ServiceDataAccessAuthIdentity", &o.ServiceDataAccessAuthIdentity) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageModelSettingsClassification. -func (i ImageModelSettingsClassification) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OnlineDeployment. +func (o OnlineDeployment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "advancedSettings", i.AdvancedSettings) - populate(objectMap, "amsGradient", i.AmsGradient) - populate(objectMap, "augmentations", i.Augmentations) - populate(objectMap, "beta1", i.Beta1) - populate(objectMap, "beta2", i.Beta2) - populate(objectMap, "checkpointFrequency", i.CheckpointFrequency) - populate(objectMap, "checkpointModel", i.CheckpointModel) - populate(objectMap, "checkpointRunId", i.CheckpointRunID) - populate(objectMap, "distributed", i.Distributed) - populate(objectMap, "earlyStopping", i.EarlyStopping) - populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) - populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) - populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) - populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) - populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) - populate(objectMap, "layersToFreeze", i.LayersToFreeze) - populate(objectMap, "learningRate", i.LearningRate) - populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) - populate(objectMap, "modelName", i.ModelName) - populate(objectMap, "momentum", i.Momentum) - populate(objectMap, "nesterov", i.Nesterov) - populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) - populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) - populate(objectMap, "optimizer", i.Optimizer) - populate(objectMap, "randomSeed", i.RandomSeed) - populate(objectMap, "stepLRGamma", i.StepLRGamma) - populate(objectMap, "stepLRStepSize", i.StepLRStepSize) - populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) - populate(objectMap, "trainingCropSize", i.TrainingCropSize) - populate(objectMap, "validationBatchSize", i.ValidationBatchSize) - populate(objectMap, "validationCropSize", i.ValidationCropSize) - populate(objectMap, "validationResizeSize", i.ValidationResizeSize) - populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) - populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) - populate(objectMap, "weightDecay", i.WeightDecay) - populate(objectMap, "weightedLoss", i.WeightedLoss) + populate(objectMap, "id", o.ID) + populate(objectMap, "identity", o.Identity) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "location", o.Location) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "sku", o.SKU) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "tags", o.Tags) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelSettingsClassification. -func (i *ImageModelSettingsClassification) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeployment. +func (o *OnlineDeployment) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "advancedSettings": - err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) - delete(rawMsg, key) - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) - delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) - delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) - delete(rawMsg, key) - case "beta2": - err = unpopulate(val, "Beta2", &i.Beta2) - delete(rawMsg, key) - case "checkpointFrequency": - err = unpopulate(val, "CheckpointFrequency", &i.CheckpointFrequency) - delete(rawMsg, key) - case "checkpointModel": - err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) - delete(rawMsg, key) - case "checkpointRunId": - err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) + case "identity": + err = unpopulate(val, "Identity", &o.Identity) delete(rawMsg, key) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + case "location": + err = unpopulate(val, "Location", &o.Location) delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + case "properties": + o.Properties, err = unmarshalOnlineDeploymentPropertiesClassification(val) delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + case "sku": + err = unpopulate(val, "SKU", &o.SKU) delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineDeploymentProperties. +func (o OnlineDeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appInsightsEnabled", o.AppInsightsEnabled) + populate(objectMap, "codeConfiguration", o.CodeConfiguration) + populate(objectMap, "dataCollector", o.DataCollector) + populate(objectMap, "description", o.Description) + populate(objectMap, "egressPublicNetworkAccess", o.EgressPublicNetworkAccess) + objectMap["endpointComputeType"] = o.EndpointComputeType + populate(objectMap, "environmentId", o.EnvironmentID) + populate(objectMap, "environmentVariables", o.EnvironmentVariables) + populate(objectMap, "instanceType", o.InstanceType) + populate(objectMap, "livenessProbe", o.LivenessProbe) + populate(objectMap, "model", o.Model) + populate(objectMap, "modelMountPath", o.ModelMountPath) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "readinessProbe", o.ReadinessProbe) + populate(objectMap, "requestSettings", o.RequestSettings) + populate(objectMap, "scaleSettings", o.ScaleSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeploymentProperties. +func (o *OnlineDeploymentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &o.AppInsightsEnabled) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &o.CodeConfiguration) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + case "dataCollector": + err = unpopulate(val, "DataCollector", &o.DataCollector) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "egressPublicNetworkAccess": + err = unpopulate(val, "EgressPublicNetworkAccess", &o.EgressPublicNetworkAccess) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "endpointComputeType": + err = unpopulate(val, "EndpointComputeType", &o.EndpointComputeType) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &o.EnvironmentID) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &o.EnvironmentVariables) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "instanceType": + err = unpopulate(val, "InstanceType", &o.InstanceType) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &o.LivenessProbe) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "model": + err = unpopulate(val, "Model", &o.Model) delete(rawMsg, key) - case "trainingCropSize": - err = unpopulate(val, "TrainingCropSize", &i.TrainingCropSize) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &o.ModelMountPath) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "validationCropSize": - err = unpopulate(val, "ValidationCropSize", &i.ValidationCropSize) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) delete(rawMsg, key) - case "validationResizeSize": - err = unpopulate(val, "ValidationResizeSize", &i.ValidationResizeSize) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &o.ReadinessProbe) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &o.RequestSettings) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "scaleSettings": + o.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineDeploymentTrackedResourceArmPaginatedResult. +func (o OnlineDeploymentTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeploymentTrackedResourceArmPaginatedResult. +func (o *OnlineDeploymentTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "weightedLoss": - err = unpopulate(val, "WeightedLoss", &i.WeightedLoss) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageModelSettingsObjectDetection. -func (i ImageModelSettingsObjectDetection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OnlineEndpoint. +func (o OnlineEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "advancedSettings", i.AdvancedSettings) - populate(objectMap, "amsGradient", i.AmsGradient) - populate(objectMap, "augmentations", i.Augmentations) - populate(objectMap, "beta1", i.Beta1) - populate(objectMap, "beta2", i.Beta2) - populate(objectMap, "boxDetectionsPerImage", i.BoxDetectionsPerImage) - populate(objectMap, "boxScoreThreshold", i.BoxScoreThreshold) - populate(objectMap, "checkpointFrequency", i.CheckpointFrequency) - populate(objectMap, "checkpointModel", i.CheckpointModel) - populate(objectMap, "checkpointRunId", i.CheckpointRunID) - populate(objectMap, "distributed", i.Distributed) - populate(objectMap, "earlyStopping", i.EarlyStopping) - populate(objectMap, "earlyStoppingDelay", i.EarlyStoppingDelay) - populate(objectMap, "earlyStoppingPatience", i.EarlyStoppingPatience) - populate(objectMap, "enableOnnxNormalization", i.EnableOnnxNormalization) - populate(objectMap, "evaluationFrequency", i.EvaluationFrequency) - populate(objectMap, "gradientAccumulationStep", i.GradientAccumulationStep) - populate(objectMap, "imageSize", i.ImageSize) - populate(objectMap, "layersToFreeze", i.LayersToFreeze) - populate(objectMap, "learningRate", i.LearningRate) - populate(objectMap, "learningRateScheduler", i.LearningRateScheduler) - populate(objectMap, "maxSize", i.MaxSize) - populate(objectMap, "minSize", i.MinSize) - populate(objectMap, "modelName", i.ModelName) - populate(objectMap, "modelSize", i.ModelSize) - populate(objectMap, "momentum", i.Momentum) - populate(objectMap, "multiScale", i.MultiScale) - populate(objectMap, "nesterov", i.Nesterov) - populate(objectMap, "nmsIouThreshold", i.NmsIouThreshold) - populate(objectMap, "numberOfEpochs", i.NumberOfEpochs) - populate(objectMap, "numberOfWorkers", i.NumberOfWorkers) - populate(objectMap, "optimizer", i.Optimizer) - populate(objectMap, "randomSeed", i.RandomSeed) - populate(objectMap, "stepLRGamma", i.StepLRGamma) - populate(objectMap, "stepLRStepSize", i.StepLRStepSize) - populate(objectMap, "tileGridSize", i.TileGridSize) - populate(objectMap, "tileOverlapRatio", i.TileOverlapRatio) - populate(objectMap, "tilePredictionsNmsThreshold", i.TilePredictionsNmsThreshold) - populate(objectMap, "trainingBatchSize", i.TrainingBatchSize) - populate(objectMap, "validationBatchSize", i.ValidationBatchSize) - populate(objectMap, "validationIouThreshold", i.ValidationIouThreshold) - populate(objectMap, "validationMetricType", i.ValidationMetricType) - populate(objectMap, "warmupCosineLRCycles", i.WarmupCosineLRCycles) - populate(objectMap, "warmupCosineLRWarmupEpochs", i.WarmupCosineLRWarmupEpochs) - populate(objectMap, "weightDecay", i.WeightDecay) + populate(objectMap, "id", o.ID) + populate(objectMap, "identity", o.Identity) + populate(objectMap, "kind", o.Kind) + populate(objectMap, "location", o.Location) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "sku", o.SKU) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "tags", o.Tags) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageModelSettingsObjectDetection. -func (i *ImageModelSettingsObjectDetection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineEndpoint. +func (o *OnlineEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "advancedSettings": - err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) - delete(rawMsg, key) - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) - delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) - delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) - delete(rawMsg, key) - case "beta2": - err = unpopulate(val, "Beta2", &i.Beta2) - delete(rawMsg, key) - case "boxDetectionsPerImage": - err = unpopulate(val, "BoxDetectionsPerImage", &i.BoxDetectionsPerImage) - delete(rawMsg, key) - case "boxScoreThreshold": - err = unpopulate(val, "BoxScoreThreshold", &i.BoxScoreThreshold) - delete(rawMsg, key) - case "checkpointFrequency": - err = unpopulate(val, "CheckpointFrequency", &i.CheckpointFrequency) - delete(rawMsg, key) - case "checkpointModel": - err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) - delete(rawMsg, key) - case "checkpointRunId": - err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) - delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) - delete(rawMsg, key) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) - delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) - delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) - delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + case "identity": + err = unpopulate(val, "Identity", &o.Identity) delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) - case "imageSize": - err = unpopulate(val, "ImageSize", &i.ImageSize) + case "location": + err = unpopulate(val, "Location", &o.Location) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + case "sku": + err = unpopulate(val, "SKU", &o.SKU) delete(rawMsg, key) - case "maxSize": - err = unpopulate(val, "MaxSize", &i.MaxSize) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) - case "minSize": - err = unpopulate(val, "MinSize", &i.MinSize) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) - case "modelSize": - err = unpopulate(val, "ModelSize", &i.ModelSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineEndpointProperties. +func (o OnlineEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authMode", o.AuthMode) + populate(objectMap, "compute", o.Compute) + populate(objectMap, "description", o.Description) + populate(objectMap, "keys", o.Keys) + populate(objectMap, "mirrorTraffic", o.MirrorTraffic) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "publicNetworkAccess", o.PublicNetworkAccess) + populate(objectMap, "scoringUri", o.ScoringURI) + populate(objectMap, "swaggerUri", o.SwaggerURI) + populate(objectMap, "traffic", o.Traffic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineEndpointProperties. +func (o *OnlineEndpointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authMode": + err = unpopulate(val, "AuthMode", &o.AuthMode) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + case "compute": + err = unpopulate(val, "Compute", &o.Compute) delete(rawMsg, key) - case "multiScale": - err = unpopulate(val, "MultiScale", &i.MultiScale) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + case "keys": + err = unpopulate(val, "Keys", &o.Keys) delete(rawMsg, key) - case "nmsIouThreshold": - err = unpopulate(val, "NmsIouThreshold", &i.NmsIouThreshold) + case "mirrorTraffic": + err = unpopulate(val, "MirrorTraffic", &o.MirrorTraffic) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &o.PublicNetworkAccess) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "scoringUri": + err = unpopulate(val, "ScoringURI", &o.ScoringURI) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "swaggerUri": + err = unpopulate(val, "SwaggerURI", &o.SwaggerURI) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "traffic": + err = unpopulate(val, "Traffic", &o.Traffic) delete(rawMsg, key) - case "tileGridSize": - err = unpopulate(val, "TileGridSize", &i.TileGridSize) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineEndpointTrackedResourceArmPaginatedResult. +func (o OnlineEndpointTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineEndpointTrackedResourceArmPaginatedResult. +func (o *OnlineEndpointTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "tileOverlapRatio": - err = unpopulate(val, "TileOverlapRatio", &i.TileOverlapRatio) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) - case "tilePredictionsNmsThreshold": - err = unpopulate(val, "TilePredictionsNmsThreshold", &i.TilePredictionsNmsThreshold) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineInferenceConfiguration. +func (o OnlineInferenceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configurations", o.Configurations) + populate(objectMap, "entryScript", o.EntryScript) + populate(objectMap, "livenessRoute", o.LivenessRoute) + populate(objectMap, "readinessRoute", o.ReadinessRoute) + populate(objectMap, "scoringRoute", o.ScoringRoute) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineInferenceConfiguration. +func (o *OnlineInferenceConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurations": + err = unpopulate(val, "Configurations", &o.Configurations) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "entryScript": + err = unpopulate(val, "EntryScript", &o.EntryScript) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "livenessRoute": + err = unpopulate(val, "LivenessRoute", &o.LivenessRoute) delete(rawMsg, key) - case "validationIouThreshold": - err = unpopulate(val, "ValidationIouThreshold", &i.ValidationIouThreshold) + case "readinessRoute": + err = unpopulate(val, "ReadinessRoute", &o.ReadinessRoute) delete(rawMsg, key) - case "validationMetricType": - err = unpopulate(val, "ValidationMetricType", &i.ValidationMetricType) + case "scoringRoute": + err = unpopulate(val, "ScoringRoute", &o.ScoringRoute) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineRequestSettings. +func (o OnlineRequestSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxConcurrentRequestsPerInstance", o.MaxConcurrentRequestsPerInstance) + populate(objectMap, "maxQueueWait", o.MaxQueueWait) + populate(objectMap, "requestTimeout", o.RequestTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineRequestSettings. +func (o *OnlineRequestSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxConcurrentRequestsPerInstance": + err = unpopulate(val, "MaxConcurrentRequestsPerInstance", &o.MaxConcurrentRequestsPerInstance) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "maxQueueWait": + err = unpopulate(val, "MaxQueueWait", &o.MaxQueueWait) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "requestTimeout": + err = unpopulate(val, "RequestTimeout", &o.RequestTimeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageObjectDetection. -func (i ImageObjectDetection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OnlineScaleSettings. +func (o OnlineScaleSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "logVerbosity", i.LogVerbosity) - populate(objectMap, "modelSettings", i.ModelSettings) - populate(objectMap, "primaryMetric", i.PrimaryMetric) - populate(objectMap, "searchSpace", i.SearchSpace) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "targetColumnName", i.TargetColumnName) - objectMap["taskType"] = TaskTypeImageObjectDetection - populate(objectMap, "trainingData", i.TrainingData) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + objectMap["scaleType"] = o.ScaleType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageObjectDetection. -func (i *ImageObjectDetection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineScaleSettings. +func (o *OnlineScaleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) - delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &i.LogVerbosity) + case "scaleType": + err = unpopulate(val, "ScaleType", &o.ScaleType) delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &i.TrainingData) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageObjectDetectionBase. -func (i ImageObjectDetectionBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "modelSettings", i.ModelSettings) - populate(objectMap, "searchSpace", i.SearchSpace) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageObjectDetectionBase. -func (i *ImageObjectDetectionBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OsPatchingStatus. +func (o OsPatchingStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "latestPatchTime", o.LatestPatchTime) + populate(objectMap, "patchStatus", o.PatchStatus) + populate(objectMap, "rebootPending", o.RebootPending) + populate(objectMap, "scheduledRebootTime", o.ScheduledRebootTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OsPatchingStatus. +func (o *OsPatchingStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "latestPatchTime": + err = unpopulate(val, "LatestPatchTime", &o.LatestPatchTime) delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) + case "patchStatus": + err = unpopulate(val, "PatchStatus", &o.PatchStatus) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "rebootPending": + err = unpopulate(val, "RebootPending", &o.RebootPending) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "scheduledRebootTime": + err = unpopulate(val, "ScheduledRebootTime", &o.ScheduledRebootTime) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageSweepSettings. -func (i ImageSweepSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundRule. +func (o OutboundRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "earlyTermination", i.EarlyTermination) - populate(objectMap, "samplingAlgorithm", i.SamplingAlgorithm) + populate(objectMap, "category", o.Category) + populate(objectMap, "status", o.Status) + objectMap["type"] = o.Type return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageSweepSettings. -func (i *ImageSweepSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundRule. +func (o *OutboundRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "earlyTermination": - i.EarlyTermination, err = unmarshalEarlyTerminationPolicyClassification(val) + case "category": + err = unpopulate(val, "Category", &o.Category) delete(rawMsg, key) - case "samplingAlgorithm": - err = unpopulate(val, "SamplingAlgorithm", &i.SamplingAlgorithm) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageVertical. -func (i ImageVertical) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundRuleBasicResource. +func (o OutboundRuleBasicResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limitSettings", i.LimitSettings) - populate(objectMap, "sweepSettings", i.SweepSettings) - populate(objectMap, "validationData", i.ValidationData) - populate(objectMap, "validationDataSize", i.ValidationDataSize) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageVertical. -func (i *ImageVertical) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundRuleBasicResource. +func (o *OutboundRuleBasicResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "properties": + o.Properties, err = unmarshalOutboundRuleClassification(val) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InferenceContainerProperties. -func (i InferenceContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundRuleListResult. +func (o OutboundRuleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "livenessRoute", i.LivenessRoute) - populate(objectMap, "readinessRoute", i.ReadinessRoute) - populate(objectMap, "scoringRoute", i.ScoringRoute) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InferenceContainerProperties. -func (i *InferenceContainerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundRuleListResult. +func (o *OutboundRuleListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "livenessRoute": - err = unpopulate(val, "LivenessRoute", &i.LivenessRoute) - delete(rawMsg, key) - case "readinessRoute": - err = unpopulate(val, "ReadinessRoute", &i.ReadinessRoute) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "scoringRoute": - err = unpopulate(val, "ScoringRoute", &i.ScoringRoute) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceTypeSchema. -func (i InstanceTypeSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutputPathAssetReference. +func (o OutputPathAssetReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nodeSelector", i.NodeSelector) - populate(objectMap, "resources", i.Resources) + populate(objectMap, "jobId", o.JobID) + populate(objectMap, "path", o.Path) + objectMap["referenceType"] = ReferenceTypeOutputPath return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceTypeSchema. -func (i *InstanceTypeSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputPathAssetReference. +func (o *OutputPathAssetReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "nodeSelector": - err = unpopulate(val, "NodeSelector", &i.NodeSelector) + case "jobId": + err = unpopulate(val, "JobID", &o.JobID) delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &i.Resources) + case "path": + err = unpopulate(val, "Path", &o.Path) + delete(rawMsg, key) + case "referenceType": + err = unpopulate(val, "ReferenceType", &o.ReferenceType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InstanceTypeSchemaResources. -func (i InstanceTypeSchemaResources) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PATAuthTypeWorkspaceConnectionProperties. +func (p PATAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limits", i.Limits) - populate(objectMap, "requests", i.Requests) + objectMap["authType"] = ConnectionAuthTypePAT + populate(objectMap, "category", p.Category) + populate(objectMap, "createdByWorkspaceArmId", p.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", p.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", p.ExpiryTime) + populate(objectMap, "isSharedToAll", p.IsSharedToAll) + populateAny(objectMap, "metadata", p.Metadata) + populate(objectMap, "target", p.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceTypeSchemaResources. -func (i *InstanceTypeSchemaResources) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PATAuthTypeWorkspaceConnectionProperties. +func (p *PATAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "limits": - err = unpopulate(val, "Limits", &i.Limits) + case "authType": + err = unpopulate(val, "AuthType", &p.AuthType) delete(rawMsg, key) - case "requests": - err = unpopulate(val, "Requests", &i.Requests) + case "category": + err = unpopulate(val, "Category", &p.Category) + delete(rawMsg, key) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &p.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &p.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &p.ExpiryTime) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &p.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &p.Metadata) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &p.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobBase. -func (j JobBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PackageInputPathBase. +func (p PackageInputPathBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "systemData", j.SystemData) - populate(objectMap, "type", j.Type) + objectMap["inputPathType"] = p.InputPathType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobBase. -func (j *JobBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageInputPathBase. +func (p *PackageInputPathBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "properties": - j.Properties, err = unmarshalJobBasePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &j.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "inputPathType": + err = unpopulate(val, "InputPathType", &p.InputPathType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobBaseProperties. -func (j JobBaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PackageInputPathID. +func (p PackageInputPathID) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "componentId", j.ComponentID) - populate(objectMap, "computeId", j.ComputeID) - populate(objectMap, "description", j.Description) - populate(objectMap, "displayName", j.DisplayName) - populate(objectMap, "experimentName", j.ExperimentName) - populate(objectMap, "identity", j.Identity) - populate(objectMap, "isArchived", j.IsArchived) - objectMap["jobType"] = j.JobType - populate(objectMap, "properties", j.Properties) - populate(objectMap, "services", j.Services) - populate(objectMap, "status", j.Status) - populate(objectMap, "tags", j.Tags) + objectMap["inputPathType"] = InputPathTypePathID + populate(objectMap, "resourceId", p.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobBaseProperties. -func (j *JobBaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageInputPathID. +func (p *PackageInputPathID) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "componentId": - err = unpopulate(val, "ComponentID", &j.ComponentID) - delete(rawMsg, key) - case "computeId": - err = unpopulate(val, "ComputeID", &j.ComputeID) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &j.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &j.DisplayName) - delete(rawMsg, key) - case "experimentName": - err = unpopulate(val, "ExperimentName", &j.ExperimentName) - delete(rawMsg, key) - case "identity": - j.Identity, err = unmarshalIdentityConfigurationClassification(val) - delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &j.IsArchived) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &j.JobType) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &j.Services) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "inputPathType": + err = unpopulate(val, "InputPathType", &p.InputPathType) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) + case "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobBaseResourceArmPaginatedResult. -func (j JobBaseResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PackageInputPathURL. +func (p PackageInputPathURL) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + objectMap["inputPathType"] = InputPathTypeURL + populate(objectMap, "url", p.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobBaseResourceArmPaginatedResult. -func (j *JobBaseResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageInputPathURL. +func (p *PackageInputPathURL) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &j.NextLink) + case "inputPathType": + err = unpopulate(val, "InputPathType", &p.InputPathType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + case "url": + err = unpopulate(val, "URL", &p.URL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobInput. -func (j JobInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PackageInputPathVersion. +func (p PackageInputPathVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", j.Description) - objectMap["jobInputType"] = j.JobInputType + objectMap["inputPathType"] = InputPathTypePathVersion + populate(objectMap, "resourceName", p.ResourceName) + populate(objectMap, "resourceVersion", p.ResourceVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobInput. -func (j *JobInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageInputPathVersion. +func (p *PackageInputPathVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &j.Description) + case "inputPathType": + err = unpopulate(val, "InputPathType", &p.InputPathType) delete(rawMsg, key) - case "jobInputType": - err = unpopulate(val, "JobInputType", &j.JobInputType) + case "resourceName": + err = unpopulate(val, "ResourceName", &p.ResourceName) + delete(rawMsg, key) + case "resourceVersion": + err = unpopulate(val, "ResourceVersion", &p.ResourceVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobLimits. -func (j JobLimits) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PackageRequest. +func (p PackageRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["jobLimitsType"] = j.JobLimitsType - populate(objectMap, "timeout", j.Timeout) + populate(objectMap, "baseEnvironmentSource", p.BaseEnvironmentSource) + populate(objectMap, "environmentVariables", p.EnvironmentVariables) + populate(objectMap, "inferencingServer", p.InferencingServer) + populate(objectMap, "inputs", p.Inputs) + populate(objectMap, "modelConfiguration", p.ModelConfiguration) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "targetEnvironmentId", p.TargetEnvironmentID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobLimits. -func (j *JobLimits) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageRequest. +func (p *PackageRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "jobLimitsType": - err = unpopulate(val, "JobLimitsType", &j.JobLimitsType) + case "baseEnvironmentSource": + p.BaseEnvironmentSource, err = unmarshalBaseEnvironmentSourceClassification(val) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &j.Timeout) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &p.EnvironmentVariables) + delete(rawMsg, key) + case "inferencingServer": + p.InferencingServer, err = unmarshalInferencingServerClassification(val) + delete(rawMsg, key) + case "inputs": + err = unpopulate(val, "Inputs", &p.Inputs) + delete(rawMsg, key) + case "modelConfiguration": + err = unpopulate(val, "ModelConfiguration", &p.ModelConfiguration) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "targetEnvironmentId": + err = unpopulate(val, "TargetEnvironmentID", &p.TargetEnvironmentID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobOutput. -func (j JobOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PackageResponse. +func (p PackageResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", j.Description) - objectMap["jobOutputType"] = j.JobOutputType + populate(objectMap, "baseEnvironmentSource", p.BaseEnvironmentSource) + populate(objectMap, "buildId", p.BuildID) + populate(objectMap, "buildState", p.BuildState) + populate(objectMap, "environmentVariables", p.EnvironmentVariables) + populate(objectMap, "inferencingServer", p.InferencingServer) + populate(objectMap, "inputs", p.Inputs) + populate(objectMap, "logUrl", p.LogURL) + populate(objectMap, "modelConfiguration", p.ModelConfiguration) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "targetEnvironmentId", p.TargetEnvironmentID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobOutput. -func (j *JobOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PackageResponse. +func (p *PackageResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &j.Description) + case "baseEnvironmentSource": + p.BaseEnvironmentSource, err = unmarshalBaseEnvironmentSourceClassification(val) delete(rawMsg, key) - case "jobOutputType": - err = unpopulate(val, "JobOutputType", &j.JobOutputType) + case "buildId": + err = unpopulate(val, "BuildID", &p.BuildID) + delete(rawMsg, key) + case "buildState": + err = unpopulate(val, "BuildState", &p.BuildState) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &p.EnvironmentVariables) + delete(rawMsg, key) + case "inferencingServer": + p.InferencingServer, err = unmarshalInferencingServerClassification(val) + delete(rawMsg, key) + case "inputs": + err = unpopulate(val, "Inputs", &p.Inputs) + delete(rawMsg, key) + case "logUrl": + err = unpopulate(val, "LogURL", &p.LogURL) + delete(rawMsg, key) + case "modelConfiguration": + err = unpopulate(val, "ModelConfiguration", &p.ModelConfiguration) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "targetEnvironmentId": + err = unpopulate(val, "TargetEnvironmentID", &p.TargetEnvironmentID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobResourceConfiguration. -func (j JobResourceConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PaginatedComputeResourcesList. +func (p PaginatedComputeResourcesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dockerArgs", j.DockerArgs) - populate(objectMap, "instanceCount", j.InstanceCount) - populate(objectMap, "instanceType", j.InstanceType) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "shmSize", j.ShmSize) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobResourceConfiguration. -func (j *JobResourceConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PaginatedComputeResourcesList. +func (p *PaginatedComputeResourcesList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dockerArgs": - err = unpopulate(val, "DockerArgs", &j.DockerArgs) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &j.InstanceCount) - delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &j.InstanceType) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "shmSize": - err = unpopulate(val, "ShmSize", &j.ShmSize) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobScheduleAction. -func (j JobScheduleAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialBatchDeployment. +func (p PartialBatchDeployment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["actionType"] = ScheduleActionTypeCreateJob - populate(objectMap, "jobDefinition", j.JobDefinition) + populate(objectMap, "description", p.Description) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobScheduleAction. -func (j *JobScheduleAction) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialBatchDeployment. +func (p *PartialBatchDeployment) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "actionType": - err = unpopulate(val, "ActionType", &j.ActionType) - delete(rawMsg, key) - case "jobDefinition": - j.JobDefinition, err = unmarshalJobBasePropertiesClassification(val) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobService. -func (j JobService) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. +func (p PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endpoint", j.Endpoint) - populate(objectMap, "errorMessage", j.ErrorMessage) - populate(objectMap, "jobServiceType", j.JobServiceType) - populate(objectMap, "port", j.Port) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "status", j.Status) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobService. -func (j *JobService) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. +func (p *PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "endpoint": - err = unpopulate(val, "Endpoint", &j.Endpoint) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &j.ErrorMessage) - delete(rawMsg, key) - case "jobServiceType": - err = unpopulate(val, "JobServiceType", &j.JobServiceType) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &j.Port) - delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Kubernetes. -func (k Kubernetes) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialJobBase. +func (p PartialJobBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeLocation", k.ComputeLocation) - objectMap["computeType"] = ComputeTypeKubernetes - populateTimeRFC3339(objectMap, "createdOn", k.CreatedOn) - populate(objectMap, "description", k.Description) - populate(objectMap, "disableLocalAuth", k.DisableLocalAuth) - populate(objectMap, "isAttachedCompute", k.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", k.ModifiedOn) - populate(objectMap, "properties", k.Properties) - populate(objectMap, "provisioningErrors", k.ProvisioningErrors) - populate(objectMap, "provisioningState", k.ProvisioningState) - populate(objectMap, "resourceId", k.ResourceID) + populate(objectMap, "notificationSetting", p.NotificationSetting) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Kubernetes. -func (k *Kubernetes) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialJobBase. +func (p *PartialJobBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &k.ComputeLocation) - delete(rawMsg, key) - case "computeType": - err = unpopulate(val, "ComputeType", &k.ComputeType) - delete(rawMsg, key) - case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &k.CreatedOn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &k.Description) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &k.DisableLocalAuth) - delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &k.IsAttachedCompute) - delete(rawMsg, key) - case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &k.ModifiedOn) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &k.Properties) - delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &k.ProvisioningErrors) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &k.ResourceID) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &p.NotificationSetting) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KubernetesOnlineDeployment. -func (k KubernetesOnlineDeployment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialJobBasePartialResource. +func (p PartialJobBasePartialResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appInsightsEnabled", k.AppInsightsEnabled) - populate(objectMap, "codeConfiguration", k.CodeConfiguration) - populate(objectMap, "containerResourceRequirements", k.ContainerResourceRequirements) - populate(objectMap, "description", k.Description) - populate(objectMap, "egressPublicNetworkAccess", k.EgressPublicNetworkAccess) - objectMap["endpointComputeType"] = EndpointComputeTypeKubernetes - populate(objectMap, "environmentId", k.EnvironmentID) - populate(objectMap, "environmentVariables", k.EnvironmentVariables) - populate(objectMap, "instanceType", k.InstanceType) - populate(objectMap, "livenessProbe", k.LivenessProbe) - populate(objectMap, "model", k.Model) - populate(objectMap, "modelMountPath", k.ModelMountPath) - populate(objectMap, "properties", k.Properties) - populate(objectMap, "provisioningState", k.ProvisioningState) - populate(objectMap, "readinessProbe", k.ReadinessProbe) - populate(objectMap, "requestSettings", k.RequestSettings) - populate(objectMap, "scaleSettings", k.ScaleSettings) + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesOnlineDeployment. -func (k *KubernetesOnlineDeployment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialJobBasePartialResource. +func (p *PartialJobBasePartialResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "appInsightsEnabled": - err = unpopulate(val, "AppInsightsEnabled", &k.AppInsightsEnabled) - delete(rawMsg, key) - case "codeConfiguration": - err = unpopulate(val, "CodeConfiguration", &k.CodeConfiguration) - delete(rawMsg, key) - case "containerResourceRequirements": - err = unpopulate(val, "ContainerResourceRequirements", &k.ContainerResourceRequirements) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &k.Description) - delete(rawMsg, key) - case "egressPublicNetworkAccess": - err = unpopulate(val, "EgressPublicNetworkAccess", &k.EgressPublicNetworkAccess) - delete(rawMsg, key) - case "endpointComputeType": - err = unpopulate(val, "EndpointComputeType", &k.EndpointComputeType) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &k.EnvironmentID) - delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &k.EnvironmentVariables) - delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &k.InstanceType) - delete(rawMsg, key) - case "livenessProbe": - err = unpopulate(val, "LivenessProbe", &k.LivenessProbe) - delete(rawMsg, key) - case "model": - err = unpopulate(val, "Model", &k.Model) - delete(rawMsg, key) - case "modelMountPath": - err = unpopulate(val, "ModelMountPath", &k.ModelMountPath) - delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &k.Properties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) - delete(rawMsg, key) - case "readinessProbe": - err = unpopulate(val, "ReadinessProbe", &k.ReadinessProbe) - delete(rawMsg, key) - case "requestSettings": - err = unpopulate(val, "RequestSettings", &k.RequestSettings) - delete(rawMsg, key) - case "scaleSettings": - k.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KubernetesProperties. -func (k KubernetesProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialManagedServiceIdentity. +func (p PartialManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultInstanceType", k.DefaultInstanceType) - populate(objectMap, "extensionInstanceReleaseTrain", k.ExtensionInstanceReleaseTrain) - populate(objectMap, "extensionPrincipalId", k.ExtensionPrincipalID) - populate(objectMap, "instanceTypes", k.InstanceTypes) - populate(objectMap, "namespace", k.Namespace) - populate(objectMap, "relayConnectionString", k.RelayConnectionString) - populate(objectMap, "serviceBusConnectionString", k.ServiceBusConnectionString) - populate(objectMap, "vcName", k.VcName) + populate(objectMap, "type", p.Type) + populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesProperties. -func (k *KubernetesProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialManagedServiceIdentity. +func (p *PartialManagedServiceIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "defaultInstanceType": - err = unpopulate(val, "DefaultInstanceType", &k.DefaultInstanceType) - delete(rawMsg, key) - case "extensionInstanceReleaseTrain": - err = unpopulate(val, "ExtensionInstanceReleaseTrain", &k.ExtensionInstanceReleaseTrain) - delete(rawMsg, key) - case "extensionPrincipalId": - err = unpopulate(val, "ExtensionPrincipalID", &k.ExtensionPrincipalID) - delete(rawMsg, key) - case "instanceTypes": - err = unpopulate(val, "InstanceTypes", &k.InstanceTypes) - delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &k.Namespace) - delete(rawMsg, key) - case "relayConnectionString": - err = unpopulate(val, "RelayConnectionString", &k.RelayConnectionString) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) - case "serviceBusConnectionString": - err = unpopulate(val, "ServiceBusConnectionString", &k.ServiceBusConnectionString) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &p.UserAssignedIdentities) delete(rawMsg, key) - case "vcName": - err = unpopulate(val, "VcName", &k.VcName) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResource. +func (p PartialMinimalTrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResource. +func (p *PartialMinimalTrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KubernetesSchema. -func (k KubernetesSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithIdentity. +func (p PartialMinimalTrackedResourceWithIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", k.Properties) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesSchema. -func (k *KubernetesSchema) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResourceWithIdentity. +func (p *PartialMinimalTrackedResourceWithIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &k.Properties) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListAmlUserFeatureResult. -func (l ListAmlUserFeatureResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithSKU. +func (p PartialMinimalTrackedResourceWithSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListAmlUserFeatureResult. -func (l *ListAmlUserFeatureResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResourceWithSKU. +func (p *PartialMinimalTrackedResourceWithSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListNotebookKeysResult. -func (l ListNotebookKeysResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithSKUAndIdentity. +func (p PartialMinimalTrackedResourceWithSKUAndIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "primaryAccessKey", l.PrimaryAccessKey) - populate(objectMap, "secondaryAccessKey", l.SecondaryAccessKey) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListNotebookKeysResult. -func (l *ListNotebookKeysResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResourceWithSKUAndIdentity. +func (p *PartialMinimalTrackedResourceWithSKUAndIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "primaryAccessKey": - err = unpopulate(val, "PrimaryAccessKey", &l.PrimaryAccessKey) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "secondaryAccessKey": - err = unpopulate(val, "SecondaryAccessKey", &l.SecondaryAccessKey) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListStorageAccountKeysResult. -func (l ListStorageAccountKeysResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialNotificationSetting. +func (p PartialNotificationSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "userStorageKey", l.UserStorageKey) + populate(objectMap, "webhooks", p.Webhooks) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListStorageAccountKeysResult. -func (l *ListStorageAccountKeysResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialNotificationSetting. +func (p *PartialNotificationSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "userStorageKey": - err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + case "webhooks": + p.Webhooks, err = unmarshalWebhookClassificationMap(val) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. -func (l ListUsagesResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialRegistryPartialTrackedResource. +func (p PartialRegistryPartialTrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. -func (l *ListUsagesResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialRegistryPartialTrackedResource. +func (p *PartialRegistryPartialTrackedResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListWorkspaceKeysResult. -func (l ListWorkspaceKeysResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialSKU. +func (p PartialSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appInsightsInstrumentationKey", l.AppInsightsInstrumentationKey) - populate(objectMap, "containerRegistryCredentials", l.ContainerRegistryCredentials) - populate(objectMap, "notebookAccessKeys", l.NotebookAccessKeys) - populate(objectMap, "userStorageKey", l.UserStorageKey) - populate(objectMap, "userStorageResourceId", l.UserStorageResourceID) + populate(objectMap, "capacity", p.Capacity) + populate(objectMap, "family", p.Family) + populate(objectMap, "name", p.Name) + populate(objectMap, "size", p.Size) + populate(objectMap, "tier", p.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListWorkspaceKeysResult. -func (l *ListWorkspaceKeysResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialSKU. +func (p *PartialSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "appInsightsInstrumentationKey": - err = unpopulate(val, "AppInsightsInstrumentationKey", &l.AppInsightsInstrumentationKey) + case "capacity": + err = unpopulate(val, "Capacity", &p.Capacity) delete(rawMsg, key) - case "containerRegistryCredentials": - err = unpopulate(val, "ContainerRegistryCredentials", &l.ContainerRegistryCredentials) + case "family": + err = unpopulate(val, "Family", &p.Family) delete(rawMsg, key) - case "notebookAccessKeys": - err = unpopulate(val, "NotebookAccessKeys", &l.NotebookAccessKeys) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "userStorageKey": - err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + case "size": + err = unpopulate(val, "Size", &p.Size) delete(rawMsg, key) - case "userStorageResourceId": - err = unpopulate(val, "UserStorageResourceID", &l.UserStorageResourceID) + case "tier": + err = unpopulate(val, "Tier", &p.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListWorkspaceQuotas. -func (l ListWorkspaceQuotas) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Password. +func (p Password) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "name", p.Name) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ListWorkspaceQuotas. -func (l *ListWorkspaceQuotas) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Password. +func (p *Password) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LiteralJobInput. -func (l LiteralJobInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PendingUploadCredentialDto. +func (p PendingUploadCredentialDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", l.Description) - objectMap["jobInputType"] = JobInputTypeLiteral - populate(objectMap, "value", l.Value) + objectMap["credentialType"] = p.CredentialType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LiteralJobInput. -func (l *LiteralJobInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PendingUploadCredentialDto. +func (p *PendingUploadCredentialDto) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &l.Description) - delete(rawMsg, key) - case "jobInputType": - err = unpopulate(val, "JobInputType", &l.JobInputType) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) + case "credentialType": + err = unpopulate(val, "CredentialType", &p.CredentialType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MLFlowModelJobInput. -func (m MLFlowModelJobInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PendingUploadRequestDto. +func (p PendingUploadRequestDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", m.Description) - objectMap["jobInputType"] = JobInputTypeMlflowModel - populate(objectMap, "mode", m.Mode) - populate(objectMap, "uri", m.URI) + populate(objectMap, "pendingUploadId", p.PendingUploadID) + populate(objectMap, "pendingUploadType", p.PendingUploadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MLFlowModelJobInput. -func (m *MLFlowModelJobInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PendingUploadRequestDto. +func (p *PendingUploadRequestDto) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "jobInputType": - err = unpopulate(val, "JobInputType", &m.JobInputType) + case "pendingUploadId": + err = unpopulate(val, "PendingUploadID", &p.PendingUploadID) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &m.Mode) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "pendingUploadType": + err = unpopulate(val, "PendingUploadType", &p.PendingUploadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MLFlowModelJobOutput. -func (m MLFlowModelJobOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PendingUploadResponseDto. +func (p PendingUploadResponseDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", m.Description) - objectMap["jobOutputType"] = JobOutputTypeMlflowModel - populate(objectMap, "mode", m.Mode) - populate(objectMap, "uri", m.URI) + populate(objectMap, "blobReferenceForConsumption", p.BlobReferenceForConsumption) + populate(objectMap, "pendingUploadId", p.PendingUploadID) + populate(objectMap, "pendingUploadType", p.PendingUploadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MLFlowModelJobOutput. -func (m *MLFlowModelJobOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PendingUploadResponseDto. +func (p *PendingUploadResponseDto) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) + case "blobReferenceForConsumption": + err = unpopulate(val, "BlobReferenceForConsumption", &p.BlobReferenceForConsumption) delete(rawMsg, key) - case "jobOutputType": - err = unpopulate(val, "JobOutputType", &m.JobOutputType) + case "pendingUploadId": + err = unpopulate(val, "PendingUploadID", &p.PendingUploadID) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &m.Mode) + case "pendingUploadType": + err = unpopulate(val, "PendingUploadType", &p.PendingUploadType) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PersonalComputeInstanceSettings. +func (p PersonalComputeInstanceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assignedUser", p.AssignedUser) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PersonalComputeInstanceSettings. +func (p *PersonalComputeInstanceSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "assignedUser": + err = unpopulate(val, "AssignedUser", &p.AssignedUser) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MLTableData. -func (m MLTableData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineJob. +func (p PipelineJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["dataType"] = DataTypeMltable - populate(objectMap, "dataUri", m.DataURI) - populate(objectMap, "description", m.Description) - populate(objectMap, "isAnonymous", m.IsAnonymous) - populate(objectMap, "isArchived", m.IsArchived) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "referencedUris", m.ReferencedUris) - populate(objectMap, "tags", m.Tags) + populate(objectMap, "componentId", p.ComponentID) + populate(objectMap, "computeId", p.ComputeID) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "experimentName", p.ExperimentName) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "inputs", p.Inputs) + populate(objectMap, "isArchived", p.IsArchived) + objectMap["jobType"] = JobTypePipeline + populate(objectMap, "jobs", p.Jobs) + populate(objectMap, "notificationSetting", p.NotificationSetting) + populate(objectMap, "outputs", p.Outputs) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "secretsConfiguration", p.SecretsConfiguration) + populate(objectMap, "services", p.Services) + populateAny(objectMap, "settings", p.Settings) + populate(objectMap, "sourceJobId", p.SourceJobID) + populate(objectMap, "status", p.Status) + populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableData. -func (m *MLTableData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineJob. +func (p *PipelineJob) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "dataType": - err = unpopulate(val, "DataType", &m.DataType) + case "componentId": + err = unpopulate(val, "ComponentID", &p.ComponentID) delete(rawMsg, key) - case "dataUri": - err = unpopulate(val, "DataURI", &m.DataURI) + case "computeId": + err = unpopulate(val, "ComputeID", &p.ComputeID) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &m.Description) + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "isAnonymous": - err = unpopulate(val, "IsAnonymous", &m.IsAnonymous) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &p.ExperimentName) + delete(rawMsg, key) + case "identity": + p.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "inputs": + p.Inputs, err = unmarshalJobInputClassificationMap(val) delete(rawMsg, key) case "isArchived": - err = unpopulate(val, "IsArchived", &m.IsArchived) + err = unpopulate(val, "IsArchived", &p.IsArchived) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &p.JobType) + delete(rawMsg, key) + case "jobs": + err = unpopulate(val, "Jobs", &p.Jobs) + delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &p.NotificationSetting) + delete(rawMsg, key) + case "outputs": + p.Outputs, err = unmarshalJobOutputClassificationMap(val) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "referencedUris": - err = unpopulate(val, "ReferencedUris", &m.ReferencedUris) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &p.SecretsConfiguration) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &p.Services) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &p.Settings) + delete(rawMsg, key) + case "sourceJobId": + err = unpopulate(val, "SourceJobID", &p.SourceJobID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &m.Tags) + err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MLTableJobInput. -func (m MLTableJobInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PoolEnvironmentConfiguration. +func (p PoolEnvironmentConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", m.Description) - objectMap["jobInputType"] = JobInputTypeMltable - populate(objectMap, "mode", m.Mode) - populate(objectMap, "uri", m.URI) + populate(objectMap, "environmentId", p.EnvironmentID) + populate(objectMap, "environmentVariables", p.EnvironmentVariables) + populate(objectMap, "livenessProbe", p.LivenessProbe) + populate(objectMap, "readinessProbe", p.ReadinessProbe) + populate(objectMap, "startupProbe", p.StartupProbe) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableJobInput. -func (m *MLTableJobInput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PoolEnvironmentConfiguration. +func (p *PoolEnvironmentConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &p.EnvironmentID) delete(rawMsg, key) - case "jobInputType": - err = unpopulate(val, "JobInputType", &m.JobInputType) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &p.EnvironmentVariables) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &m.Mode) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &p.LivenessProbe) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &p.ReadinessProbe) + delete(rawMsg, key) + case "startupProbe": + err = unpopulate(val, "StartupProbe", &p.StartupProbe) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MLTableJobOutput. -func (m MLTableJobOutput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PoolModelConfiguration. +func (p PoolModelConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", m.Description) - objectMap["jobOutputType"] = JobOutputTypeMltable - populate(objectMap, "mode", m.Mode) - populate(objectMap, "uri", m.URI) + populate(objectMap, "modelId", p.ModelID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MLTableJobOutput. -func (m *MLTableJobOutput) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PoolModelConfiguration. +func (p *PoolModelConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "jobOutputType": - err = unpopulate(val, "JobOutputType", &m.JobOutputType) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &m.Mode) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "modelId": + err = unpopulate(val, "ModelID", &p.ModelID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedIdentity. -func (m ManagedIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PoolStatus. +func (p PoolStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", m.ClientID) - objectMap["identityType"] = IdentityConfigurationTypeManaged - populate(objectMap, "objectId", m.ObjectID) - populate(objectMap, "resourceId", m.ResourceID) + populate(objectMap, "actualCapacity", p.ActualCapacity) + populate(objectMap, "groupCount", p.GroupCount) + populate(objectMap, "requestedCapacity", p.RequestedCapacity) + populate(objectMap, "reservedCapacity", p.ReservedCapacity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentity. -func (m *ManagedIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PoolStatus. +func (p *PoolStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &m.ClientID) + case "actualCapacity": + err = unpopulate(val, "ActualCapacity", &p.ActualCapacity) delete(rawMsg, key) - case "identityType": - err = unpopulate(val, "IdentityType", &m.IdentityType) + case "groupCount": + err = unpopulate(val, "GroupCount", &p.GroupCount) delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &m.ObjectID) + case "requestedCapacity": + err = unpopulate(val, "RequestedCapacity", &p.RequestedCapacity) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &m.ResourceID) + case "reservedCapacity": + err = unpopulate(val, "ReservedCapacity", &p.ReservedCapacity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. -func (m ManagedIdentityAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PredictionDriftMetricThresholdBase. +func (p PredictionDriftMetricThresholdBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["authType"] = ConnectionAuthTypeManagedIdentity - populate(objectMap, "category", m.Category) - populate(objectMap, "credentials", m.Credentials) - populate(objectMap, "target", m.Target) - populate(objectMap, "value", m.Value) - populate(objectMap, "valueFormat", m.ValueFormat) + objectMap["dataType"] = p.DataType + populate(objectMap, "threshold", p.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityAuthTypeWorkspaceConnectionProperties. -func (m *ManagedIdentityAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PredictionDriftMetricThresholdBase. +func (p *PredictionDriftMetricThresholdBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "authType": - err = unpopulate(val, "AuthType", &m.AuthType) - delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &m.Category) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &m.Credentials) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &m.Target) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "dataType": + err = unpopulate(val, "DataType", &p.DataType) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &m.ValueFormat) + case "threshold": + err = unpopulate(val, "Threshold", &p.Threshold) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedOnlineDeployment. -func (m ManagedOnlineDeployment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PredictionDriftMonitoringSignal. +func (p PredictionDriftMonitoringSignal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appInsightsEnabled", m.AppInsightsEnabled) - populate(objectMap, "codeConfiguration", m.CodeConfiguration) - populate(objectMap, "description", m.Description) - populate(objectMap, "egressPublicNetworkAccess", m.EgressPublicNetworkAccess) - objectMap["endpointComputeType"] = EndpointComputeTypeManaged - populate(objectMap, "environmentId", m.EnvironmentID) - populate(objectMap, "environmentVariables", m.EnvironmentVariables) - populate(objectMap, "instanceType", m.InstanceType) - populate(objectMap, "livenessProbe", m.LivenessProbe) - populate(objectMap, "model", m.Model) - populate(objectMap, "modelMountPath", m.ModelMountPath) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "readinessProbe", m.ReadinessProbe) - populate(objectMap, "requestSettings", m.RequestSettings) - populate(objectMap, "scaleSettings", m.ScaleSettings) + populate(objectMap, "featureDataTypeOverride", p.FeatureDataTypeOverride) + populate(objectMap, "metricThresholds", p.MetricThresholds) + populate(objectMap, "notificationTypes", p.NotificationTypes) + populate(objectMap, "productionData", p.ProductionData) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "referenceData", p.ReferenceData) + objectMap["signalType"] = MonitoringSignalTypePredictionDrift return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedOnlineDeployment. -func (m *ManagedOnlineDeployment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PredictionDriftMonitoringSignal. +func (p *PredictionDriftMonitoringSignal) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "appInsightsEnabled": - err = unpopulate(val, "AppInsightsEnabled", &m.AppInsightsEnabled) - delete(rawMsg, key) - case "codeConfiguration": - err = unpopulate(val, "CodeConfiguration", &m.CodeConfiguration) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "egressPublicNetworkAccess": - err = unpopulate(val, "EgressPublicNetworkAccess", &m.EgressPublicNetworkAccess) - delete(rawMsg, key) - case "endpointComputeType": - err = unpopulate(val, "EndpointComputeType", &m.EndpointComputeType) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &m.EnvironmentID) - delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &m.EnvironmentVariables) - delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &m.InstanceType) + case "featureDataTypeOverride": + err = unpopulate(val, "FeatureDataTypeOverride", &p.FeatureDataTypeOverride) delete(rawMsg, key) - case "livenessProbe": - err = unpopulate(val, "LivenessProbe", &m.LivenessProbe) + case "metricThresholds": + p.MetricThresholds, err = unmarshalPredictionDriftMetricThresholdBaseClassificationArray(val) delete(rawMsg, key) - case "model": - err = unpopulate(val, "Model", &m.Model) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &p.NotificationTypes) delete(rawMsg, key) - case "modelMountPath": - err = unpopulate(val, "ModelMountPath", &m.ModelMountPath) + case "productionData": + p.ProductionData, err = unmarshalMonitoringInputDataBaseClassification(val) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "readinessProbe": - err = unpopulate(val, "ReadinessProbe", &m.ReadinessProbe) + case "referenceData": + p.ReferenceData, err = unmarshalMonitoringInputDataBaseClassification(val) delete(rawMsg, key) - case "requestSettings": - err = unpopulate(val, "RequestSettings", &m.RequestSettings) + case "signalType": + err = unpopulate(val, "SignalType", &p.SignalType) delete(rawMsg, key) - case "scaleSettings": - m.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. -func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "location": + err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MedianStoppingPolicy. -func (m MedianStoppingPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "delayEvaluation", m.DelayEvaluation) - populate(objectMap, "evaluationInterval", m.EvaluationInterval) - objectMap["policyType"] = EarlyTerminationPolicyTypeMedianStopping + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MedianStoppingPolicy. -func (m *MedianStoppingPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "delayEvaluation": - err = unpopulate(val, "DelayEvaluation", &m.DelayEvaluation) - delete(rawMsg, key) - case "evaluationInterval": - err = unpopulate(val, "EvaluationInterval", &m.EvaluationInterval) - delete(rawMsg, key) - case "policyType": - err = unpopulate(val, "PolicyType", &m.PolicyType) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ModelContainer. -func (m ModelContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ModelContainer. -func (m *ModelContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ModelContainerProperties. -func (m ModelContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointDestination. +func (p PrivateEndpointDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", m.Description) - populate(objectMap, "isArchived", m.IsArchived) - populate(objectMap, "latestVersion", m.LatestVersion) - populate(objectMap, "nextVersion", m.NextVersion) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) + populate(objectMap, "serviceResourceId", p.ServiceResourceID) + populate(objectMap, "sparkEnabled", p.SparkEnabled) + populate(objectMap, "sparkStatus", p.SparkStatus) + populate(objectMap, "subresourceTarget", p.SubresourceTarget) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ModelContainerProperties. -func (m *ModelContainerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointDestination. +func (p *PrivateEndpointDestination) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) + case "serviceResourceId": + err = unpopulate(val, "ServiceResourceID", &p.ServiceResourceID) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &m.IsArchived) - delete(rawMsg, key) - case "latestVersion": - err = unpopulate(val, "LatestVersion", &m.LatestVersion) - delete(rawMsg, key) - case "nextVersion": - err = unpopulate(val, "NextVersion", &m.NextVersion) + case "sparkEnabled": + err = unpopulate(val, "SparkEnabled", &p.SparkEnabled) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "sparkStatus": + err = unpopulate(val, "SparkStatus", &p.SparkStatus) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "subresourceTarget": + err = unpopulate(val, "SubresourceTarget", &p.SubresourceTarget) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ModelContainerResourceArmPaginatedResult. -func (m ModelContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointOutboundRule. +func (p PrivateEndpointOutboundRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "category", p.Category) + populate(objectMap, "destination", p.Destination) + populate(objectMap, "status", p.Status) + objectMap["type"] = RuleTypePrivateEndpoint return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ModelContainerResourceArmPaginatedResult. -func (m *ModelContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointOutboundRule. +func (p *PrivateEndpointOutboundRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "category": + err = unpopulate(val, "Category", &p.Category) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "destination": + err = unpopulate(val, "Destination", &p.Destination) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ModelVersion. -func (m ModelVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointResource. +func (p PrivateEndpointResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + populate(objectMap, "id", p.ID) + populate(objectMap, "subnetArmId", p.SubnetArmID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ModelVersion. -func (m *ModelVersion) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointResource. +func (p *PrivateEndpointResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "subnetArmId": + err = unpopulate(val, "SubnetArmID", &p.SubnetArmID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ModelVersionProperties. -func (m ModelVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", m.Description) - populate(objectMap, "flavors", m.Flavors) - populate(objectMap, "isAnonymous", m.IsAnonymous) - populate(objectMap, "isArchived", m.IsArchived) - populate(objectMap, "jobName", m.JobName) - populate(objectMap, "modelType", m.ModelType) - populate(objectMap, "modelUri", m.ModelURI) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ModelVersionProperties. -func (m *ModelVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "flavors": - err = unpopulate(val, "Flavors", &m.Flavors) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "isAnonymous": - err = unpopulate(val, "IsAnonymous", &m.IsAnonymous) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &m.IsArchived) + case "location": + err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) - case "jobName": - err = unpopulate(val, "JobName", &m.JobName) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "modelType": - err = unpopulate(val, "ModelType", &m.ModelType) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "modelUri": - err = unpopulate(val, "ModelURI", &m.ModelURI) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &m.Tags) + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ModelVersionResourceArmPaginatedResult. -func (m ModelVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ModelVersionResourceArmPaginatedResult. -func (m *ModelVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &m.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Mpi. -func (m Mpi) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["distributionType"] = DistributionTypeMpi - populate(objectMap, "processCountPerInstance", m.ProcessCountPerInstance) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Mpi. -func (m *Mpi) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "distributionType": - err = unpopulate(val, "DistributionType", &m.DistributionType) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "processCountPerInstance": - err = unpopulate(val, "ProcessCountPerInstance", &m.ProcessCountPerInstance) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NCrossValidations. -func (n NCrossValidations) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = n.Mode + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NCrossValidations. -func (n *NCrossValidations) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &n.Mode) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NlpVertical. -func (n NlpVertical) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProbeSettings. +func (p ProbeSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "featurizationSettings", n.FeaturizationSettings) - populate(objectMap, "limitSettings", n.LimitSettings) - populate(objectMap, "validationData", n.ValidationData) + populate(objectMap, "failureThreshold", p.FailureThreshold) + populate(objectMap, "initialDelay", p.InitialDelay) + populate(objectMap, "period", p.Period) + populate(objectMap, "successThreshold", p.SuccessThreshold) + populate(objectMap, "timeout", p.Timeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NlpVertical. -func (n *NlpVertical) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProbeSettings. +func (p *ProbeSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "featurizationSettings": - err = unpopulate(val, "FeaturizationSettings", &n.FeaturizationSettings) + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &p.FailureThreshold) delete(rawMsg, key) - case "limitSettings": - err = unpopulate(val, "LimitSettings", &n.LimitSettings) + case "initialDelay": + err = unpopulate(val, "InitialDelay", &p.InitialDelay) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &n.ValidationData) + case "period": + err = unpopulate(val, "Period", &p.Period) + delete(rawMsg, key) + case "successThreshold": + err = unpopulate(val, "SuccessThreshold", &p.SuccessThreshold) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &p.Timeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NlpVerticalFeaturizationSettings. -func (n NlpVerticalFeaturizationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProgressMetrics. +func (p ProgressMetrics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "datasetLanguage", n.DatasetLanguage) + populate(objectMap, "completedDatapointCount", p.CompletedDatapointCount) + populateDateTimeRFC3339(objectMap, "incrementalDataLastRefreshDateTime", p.IncrementalDataLastRefreshDateTime) + populate(objectMap, "skippedDatapointCount", p.SkippedDatapointCount) + populate(objectMap, "totalDatapointCount", p.TotalDatapointCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NlpVerticalFeaturizationSettings. -func (n *NlpVerticalFeaturizationSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProgressMetrics. +func (p *ProgressMetrics) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "datasetLanguage": - err = unpopulate(val, "DatasetLanguage", &n.DatasetLanguage) + case "completedDatapointCount": + err = unpopulate(val, "CompletedDatapointCount", &p.CompletedDatapointCount) + delete(rawMsg, key) + case "incrementalDataLastRefreshDateTime": + err = unpopulateDateTimeRFC3339(val, "IncrementalDataLastRefreshDateTime", &p.IncrementalDataLastRefreshDateTime) + delete(rawMsg, key) + case "skippedDatapointCount": + err = unpopulate(val, "SkippedDatapointCount", &p.SkippedDatapointCount) + delete(rawMsg, key) + case "totalDatapointCount": + err = unpopulate(val, "TotalDatapointCount", &p.TotalDatapointCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NlpVerticalLimitSettings. -func (n NlpVerticalLimitSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PropertiesBase. +func (p PropertiesBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxConcurrentTrials", n.MaxConcurrentTrials) - populate(objectMap, "maxTrials", n.MaxTrials) - populate(objectMap, "timeout", n.Timeout) + populate(objectMap, "description", p.Description) + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NlpVerticalLimitSettings. -func (n *NlpVerticalLimitSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertiesBase. +func (p *PropertiesBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "maxConcurrentTrials": - err = unpopulate(val, "MaxConcurrentTrials", &n.MaxConcurrentTrials) - delete(rawMsg, key) - case "maxTrials": - err = unpopulate(val, "MaxTrials", &n.MaxTrials) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &n.Timeout) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NodeStateCounts. -func (n NodeStateCounts) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "idleNodeCount", n.IdleNodeCount) - populate(objectMap, "leavingNodeCount", n.LeavingNodeCount) - populate(objectMap, "preemptedNodeCount", n.PreemptedNodeCount) - populate(objectMap, "preparingNodeCount", n.PreparingNodeCount) - populate(objectMap, "runningNodeCount", n.RunningNodeCount) - populate(objectMap, "unusableNodeCount", n.UnusableNodeCount) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NodeStateCounts. -func (n *NodeStateCounts) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "idleNodeCount": - err = unpopulate(val, "IdleNodeCount", &n.IdleNodeCount) - delete(rawMsg, key) - case "leavingNodeCount": - err = unpopulate(val, "LeavingNodeCount", &n.LeavingNodeCount) - delete(rawMsg, key) - case "preemptedNodeCount": - err = unpopulate(val, "PreemptedNodeCount", &n.PreemptedNodeCount) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "preparingNodeCount": - err = unpopulate(val, "PreparingNodeCount", &n.PreparingNodeCount) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "runningNodeCount": - err = unpopulate(val, "RunningNodeCount", &n.RunningNodeCount) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "unusableNodeCount": - err = unpopulate(val, "UnusableNodeCount", &n.UnusableNodeCount) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NoneAuthTypeWorkspaceConnectionProperties. -func (n NoneAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PyTorch. +func (p PyTorch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["authType"] = ConnectionAuthTypeNone - populate(objectMap, "category", n.Category) - populate(objectMap, "target", n.Target) - populate(objectMap, "value", n.Value) - populate(objectMap, "valueFormat", n.ValueFormat) + objectMap["distributionType"] = DistributionTypePyTorch + populate(objectMap, "processCountPerInstance", p.ProcessCountPerInstance) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NoneAuthTypeWorkspaceConnectionProperties. -func (n *NoneAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PyTorch. +func (p *PyTorch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "authType": - err = unpopulate(val, "AuthType", &n.AuthType) - delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &n.Category) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &n.Target) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "distributionType": + err = unpopulate(val, "DistributionType", &p.DistributionType) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &n.ValueFormat) + case "processCountPerInstance": + err = unpopulate(val, "ProcessCountPerInstance", &p.ProcessCountPerInstance) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NoneDatastoreCredentials. -func (n NoneDatastoreCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueueSettings. +func (q QueueSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["credentialsType"] = CredentialsTypeNone + populate(objectMap, "jobTier", q.JobTier) + populate(objectMap, "priority", q.Priority) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NoneDatastoreCredentials. -func (n *NoneDatastoreCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueSettings. +func (q *QueueSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "credentialsType": - err = unpopulate(val, "CredentialsType", &n.CredentialsType) + case "jobTier": + err = unpopulate(val, "JobTier", &q.JobTier) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &q.Priority) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookAccessTokenResult. -func (n NotebookAccessTokenResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaBaseProperties. +func (q QuotaBaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessToken", n.AccessToken) - populate(objectMap, "expiresIn", n.ExpiresIn) - populate(objectMap, "hostName", n.HostName) - populate(objectMap, "notebookResourceId", n.NotebookResourceID) - populate(objectMap, "publicDns", n.PublicDNS) - populate(objectMap, "refreshToken", n.RefreshToken) - populate(objectMap, "scope", n.Scope) - populate(objectMap, "tokenType", n.TokenType) + populate(objectMap, "id", q.ID) + populate(objectMap, "limit", q.Limit) + populate(objectMap, "type", q.Type) + populate(objectMap, "unit", q.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookAccessTokenResult. -func (n *NotebookAccessTokenResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBaseProperties. +func (q *QuotaBaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "accessToken": - err = unpopulate(val, "AccessToken", &n.AccessToken) - delete(rawMsg, key) - case "expiresIn": - err = unpopulate(val, "ExpiresIn", &n.ExpiresIn) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &n.HostName) - delete(rawMsg, key) - case "notebookResourceId": - err = unpopulate(val, "NotebookResourceID", &n.NotebookResourceID) - delete(rawMsg, key) - case "publicDns": - err = unpopulate(val, "PublicDNS", &n.PublicDNS) + case "id": + err = unpopulate(val, "ID", &q.ID) delete(rawMsg, key) - case "refreshToken": - err = unpopulate(val, "RefreshToken", &n.RefreshToken) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &n.Scope) + case "type": + err = unpopulate(val, "Type", &q.Type) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &n.TokenType) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookPreparationError. -func (n NotebookPreparationError) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaUpdateParameters. +func (q QuotaUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorMessage", n.ErrorMessage) - populate(objectMap, "statusCode", n.StatusCode) + populate(objectMap, "location", q.Location) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookPreparationError. -func (n *NotebookPreparationError) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUpdateParameters. +func (q *QuotaUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &n.ErrorMessage) + case "location": + err = unpopulate(val, "Location", &q.Location) delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &n.StatusCode) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotebookResourceInfo. -func (n NotebookResourceInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RandomSamplingAlgorithm. +func (r RandomSamplingAlgorithm) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fqdn", n.Fqdn) - populate(objectMap, "notebookPreparationError", n.NotebookPreparationError) - populate(objectMap, "resourceId", n.ResourceID) + populate(objectMap, "logbase", r.Logbase) + populate(objectMap, "rule", r.Rule) + objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeRandom + populate(objectMap, "seed", r.Seed) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotebookResourceInfo. -func (n *NotebookResourceInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RandomSamplingAlgorithm. +func (r *RandomSamplingAlgorithm) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &n.Fqdn) + case "logbase": + err = unpopulate(val, "Logbase", &r.Logbase) delete(rawMsg, key) - case "notebookPreparationError": - err = unpopulate(val, "NotebookPreparationError", &n.NotebookPreparationError) + case "rule": + err = unpopulate(val, "Rule", &r.Rule) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &n.ResourceID) + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &r.SamplingAlgorithmType) + delete(rawMsg, key) + case "seed": + err = unpopulate(val, "Seed", &r.Seed) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Objective. -func (o Objective) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Ray. +func (r Ray) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "goal", o.Goal) - populate(objectMap, "primaryMetric", o.PrimaryMetric) + populate(objectMap, "address", r.Address) + populate(objectMap, "dashboardPort", r.DashboardPort) + objectMap["distributionType"] = DistributionTypeRay + populate(objectMap, "headNodeAdditionalArgs", r.HeadNodeAdditionalArgs) + populate(objectMap, "includeDashboard", r.IncludeDashboard) + populate(objectMap, "port", r.Port) + populate(objectMap, "workerNodeAdditionalArgs", r.WorkerNodeAdditionalArgs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Objective. -func (o *Objective) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Ray. +func (r *Ray) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "goal": - err = unpopulate(val, "Goal", &o.Goal) + case "address": + err = unpopulate(val, "Address", &r.Address) delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &o.PrimaryMetric) + case "dashboardPort": + err = unpopulate(val, "DashboardPort", &r.DashboardPort) + delete(rawMsg, key) + case "distributionType": + err = unpopulate(val, "DistributionType", &r.DistributionType) + delete(rawMsg, key) + case "headNodeAdditionalArgs": + err = unpopulate(val, "HeadNodeAdditionalArgs", &r.HeadNodeAdditionalArgs) + delete(rawMsg, key) + case "includeDashboard": + err = unpopulate(val, "IncludeDashboard", &r.IncludeDashboard) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &r.Port) + delete(rawMsg, key) + case "workerNodeAdditionalArgs": + err = unpopulate(val, "WorkerNodeAdditionalArgs", &r.WorkerNodeAdditionalArgs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineDeployment. -func (o OnlineDeployment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Recurrence. +func (r Recurrence) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "identity", o.Identity) - populate(objectMap, "kind", o.Kind) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "sku", o.SKU) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "tags", o.Tags) - populate(objectMap, "type", o.Type) + populate(objectMap, "frequency", r.Frequency) + populate(objectMap, "interval", r.Interval) + populate(objectMap, "schedule", r.Schedule) + populate(objectMap, "startTime", r.StartTime) + populate(objectMap, "timeZone", r.TimeZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeployment. -func (o *OnlineDeployment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Recurrence. +func (r *Recurrence) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &o.Identity) + case "frequency": + err = unpopulate(val, "Frequency", &r.Frequency) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &o.Kind) + case "interval": + err = unpopulate(val, "Interval", &r.Interval) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) + case "schedule": + err = unpopulate(val, "Schedule", &r.Schedule) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "startTime": + err = unpopulate(val, "StartTime", &r.StartTime) delete(rawMsg, key) - case "properties": - o.Properties, err = unmarshalOnlineDeploymentPropertiesClassification(val) + case "timeZone": + err = unpopulate(val, "TimeZone", &r.TimeZone) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &o.SKU) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecurrenceSchedule. +func (r RecurrenceSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hours", r.Hours) + populate(objectMap, "minutes", r.Minutes) + populate(objectMap, "monthDays", r.MonthDays) + populate(objectMap, "weekDays", r.WeekDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecurrenceSchedule. +func (r *RecurrenceSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hours": + err = unpopulate(val, "Hours", &r.Hours) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &o.SystemData) + case "minutes": + err = unpopulate(val, "Minutes", &r.Minutes) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &o.Tags) + case "monthDays": + err = unpopulate(val, "MonthDays", &r.MonthDays) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) + case "weekDays": + err = unpopulate(val, "WeekDays", &r.WeekDays) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OnlineDeploymentProperties. -func (o OnlineDeploymentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "appInsightsEnabled", o.AppInsightsEnabled) - populate(objectMap, "codeConfiguration", o.CodeConfiguration) - populate(objectMap, "description", o.Description) - populate(objectMap, "egressPublicNetworkAccess", o.EgressPublicNetworkAccess) - objectMap["endpointComputeType"] = o.EndpointComputeType - populate(objectMap, "environmentId", o.EnvironmentID) - populate(objectMap, "environmentVariables", o.EnvironmentVariables) - populate(objectMap, "instanceType", o.InstanceType) - populate(objectMap, "livenessProbe", o.LivenessProbe) - populate(objectMap, "model", o.Model) - populate(objectMap, "modelMountPath", o.ModelMountPath) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "provisioningState", o.ProvisioningState) - populate(objectMap, "readinessProbe", o.ReadinessProbe) - populate(objectMap, "requestSettings", o.RequestSettings) - populate(objectMap, "scaleSettings", o.ScaleSettings) +} + +// MarshalJSON implements the json.Marshaller interface for type RecurrenceTrigger. +func (r RecurrenceTrigger) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endTime", r.EndTime) + populate(objectMap, "frequency", r.Frequency) + populate(objectMap, "interval", r.Interval) + populate(objectMap, "schedule", r.Schedule) + populate(objectMap, "startTime", r.StartTime) + populate(objectMap, "timeZone", r.TimeZone) + objectMap["triggerType"] = TriggerTypeRecurrence return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeploymentProperties. -func (o *OnlineDeploymentProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecurrenceTrigger. +func (r *RecurrenceTrigger) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "appInsightsEnabled": - err = unpopulate(val, "AppInsightsEnabled", &o.AppInsightsEnabled) - delete(rawMsg, key) - case "codeConfiguration": - err = unpopulate(val, "CodeConfiguration", &o.CodeConfiguration) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "egressPublicNetworkAccess": - err = unpopulate(val, "EgressPublicNetworkAccess", &o.EgressPublicNetworkAccess) - delete(rawMsg, key) - case "endpointComputeType": - err = unpopulate(val, "EndpointComputeType", &o.EndpointComputeType) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &o.EnvironmentID) - delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &o.EnvironmentVariables) - delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &o.InstanceType) - delete(rawMsg, key) - case "livenessProbe": - err = unpopulate(val, "LivenessProbe", &o.LivenessProbe) - delete(rawMsg, key) - case "model": - err = unpopulate(val, "Model", &o.Model) + case "endTime": + err = unpopulate(val, "EndTime", &r.EndTime) delete(rawMsg, key) - case "modelMountPath": - err = unpopulate(val, "ModelMountPath", &o.ModelMountPath) + case "frequency": + err = unpopulate(val, "Frequency", &r.Frequency) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "interval": + err = unpopulate(val, "Interval", &r.Interval) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + case "schedule": + err = unpopulate(val, "Schedule", &r.Schedule) delete(rawMsg, key) - case "readinessProbe": - err = unpopulate(val, "ReadinessProbe", &o.ReadinessProbe) + case "startTime": + err = unpopulate(val, "StartTime", &r.StartTime) delete(rawMsg, key) - case "requestSettings": - err = unpopulate(val, "RequestSettings", &o.RequestSettings) + case "timeZone": + err = unpopulate(val, "TimeZone", &r.TimeZone) delete(rawMsg, key) - case "scaleSettings": - o.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + case "triggerType": + err = unpopulate(val, "TriggerType", &r.TriggerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineDeploymentTrackedResourceArmPaginatedResult. -func (o OnlineDeploymentTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegenerateEndpointKeysRequest. +func (r RegenerateEndpointKeysRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "keyType", r.KeyType) + populate(objectMap, "keyValue", r.KeyValue) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineDeploymentTrackedResourceArmPaginatedResult. -func (o *OnlineDeploymentTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateEndpointKeysRequest. +func (r *RegenerateEndpointKeysRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "keyType": + err = unpopulate(val, "KeyType", &r.KeyType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "keyValue": + err = unpopulate(val, "KeyValue", &r.KeyValue) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineEndpoint. -func (o OnlineEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Registry. +func (r Registry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "identity", o.Identity) - populate(objectMap, "kind", o.Kind) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "sku", o.SKU) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "tags", o.Tags) - populate(objectMap, "type", o.Type) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineEndpoint. -func (o *OnlineEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Registry. +func (r *Registry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &o.ID) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "identity": - err = unpopulate(val, "Identity", &o.Identity) + err = unpopulate(val, "Identity", &r.Identity) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &o.Kind) + err = unpopulate(val, "Kind", &r.Kind) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &o.Location) + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &o.Properties) + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) case "sku": - err = unpopulate(val, "SKU", &o.SKU) + err = unpopulate(val, "SKU", &r.SKU) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &o.SystemData) + err = unpopulate(val, "SystemData", &r.SystemData) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &o.Tags) + err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &o.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineEndpointProperties. -func (o OnlineEndpointProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryListCredentialsResult. +func (r RegistryListCredentialsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authMode", o.AuthMode) - populate(objectMap, "compute", o.Compute) - populate(objectMap, "description", o.Description) - populate(objectMap, "keys", o.Keys) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "provisioningState", o.ProvisioningState) - populate(objectMap, "publicNetworkAccess", o.PublicNetworkAccess) - populate(objectMap, "scoringUri", o.ScoringURI) - populate(objectMap, "swaggerUri", o.SwaggerURI) - populate(objectMap, "traffic", o.Traffic) + populate(objectMap, "location", r.Location) + populate(objectMap, "passwords", r.Passwords) + populate(objectMap, "username", r.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineEndpointProperties. -func (o *OnlineEndpointProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListCredentialsResult. +func (r *RegistryListCredentialsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "authMode": - err = unpopulate(val, "AuthMode", &o.AuthMode) - delete(rawMsg, key) - case "compute": - err = unpopulate(val, "Compute", &o.Compute) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "keys": - err = unpopulate(val, "Keys", &o.Keys) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "passwords": + err = unpopulate(val, "Passwords", &r.Passwords) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + case "username": + err = unpopulate(val, "Username", &r.Username) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &o.PublicNetworkAccess) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistryPartialManagedServiceIdentity. +func (r RegistryPartialManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", r.PrincipalID) + populate(objectMap, "tenantId", r.TenantID) + populate(objectMap, "type", r.Type) + populate(objectMap, "userAssignedIdentities", r.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPartialManagedServiceIdentity. +func (r *RegistryPartialManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) delete(rawMsg, key) - case "scoringUri": - err = unpopulate(val, "ScoringURI", &o.ScoringURI) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) delete(rawMsg, key) - case "swaggerUri": - err = unpopulate(val, "SwaggerURI", &o.SwaggerURI) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) - case "traffic": - err = unpopulate(val, "Traffic", &o.Traffic) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &r.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineEndpointTrackedResourceArmPaginatedResult. -func (o OnlineEndpointTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryPrivateEndpointConnection. +func (r RegistryPrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "properties", r.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineEndpointTrackedResourceArmPaginatedResult. -func (o *OnlineEndpointTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPrivateEndpointConnection. +func (r *RegistryPrivateEndpointConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineRequestSettings. -func (o OnlineRequestSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryPrivateEndpointConnectionProperties. +func (r RegistryPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxConcurrentRequestsPerInstance", o.MaxConcurrentRequestsPerInstance) - populate(objectMap, "maxQueueWait", o.MaxQueueWait) - populate(objectMap, "requestTimeout", o.RequestTimeout) + populate(objectMap, "groupIds", r.GroupIDs) + populate(objectMap, "privateEndpoint", r.PrivateEndpoint) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "registryPrivateLinkServiceConnectionState", r.RegistryPrivateLinkServiceConnectionState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineRequestSettings. -func (o *OnlineRequestSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPrivateEndpointConnectionProperties. +func (r *RegistryPrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "maxConcurrentRequestsPerInstance": - err = unpopulate(val, "MaxConcurrentRequestsPerInstance", &o.MaxConcurrentRequestsPerInstance) + case "groupIds": + err = unpopulate(val, "GroupIDs", &r.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &r.PrivateEndpoint) delete(rawMsg, key) - case "maxQueueWait": - err = unpopulate(val, "MaxQueueWait", &o.MaxQueueWait) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) delete(rawMsg, key) - case "requestTimeout": - err = unpopulate(val, "RequestTimeout", &o.RequestTimeout) + case "registryPrivateLinkServiceConnectionState": + err = unpopulate(val, "RegistryPrivateLinkServiceConnectionState", &r.RegistryPrivateLinkServiceConnectionState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineScaleSettings. -func (o OnlineScaleSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryPrivateLinkServiceConnectionState. +func (r RegistryPrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["scaleType"] = o.ScaleType + populate(objectMap, "actionsRequired", r.ActionsRequired) + populate(objectMap, "description", r.Description) + populate(objectMap, "status", r.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OnlineScaleSettings. -func (o *OnlineScaleSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPrivateLinkServiceConnectionState. +func (r *RegistryPrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "scaleType": - err = unpopulate(val, "ScaleType", &o.ScaleType) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &r.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OutputPathAssetReference. -func (o OutputPathAssetReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryProperties. +func (r RegistryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "jobId", o.JobID) - populate(objectMap, "path", o.Path) - objectMap["referenceType"] = ReferenceTypeOutputPath + populate(objectMap, "discoveryUrl", r.DiscoveryURL) + populate(objectMap, "intellectualPropertyPublisher", r.IntellectualPropertyPublisher) + populate(objectMap, "managedResourceGroup", r.ManagedResourceGroup) + populate(objectMap, "mlFlowRegistryUri", r.MlFlowRegistryURI) + populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess) + populate(objectMap, "regionDetails", r.RegionDetails) + populate(objectMap, "registryPrivateEndpointConnections", r.RegistryPrivateEndpointConnections) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OutputPathAssetReference. -func (o *OutputPathAssetReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryProperties. +func (r *RegistryProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "jobId": - err = unpopulate(val, "JobID", &o.JobID) + case "discoveryUrl": + err = unpopulate(val, "DiscoveryURL", &r.DiscoveryURL) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &o.Path) + case "intellectualPropertyPublisher": + err = unpopulate(val, "IntellectualPropertyPublisher", &r.IntellectualPropertyPublisher) delete(rawMsg, key) - case "referenceType": - err = unpopulate(val, "ReferenceType", &o.ReferenceType) + case "managedResourceGroup": + err = unpopulate(val, "ManagedResourceGroup", &r.ManagedResourceGroup) + delete(rawMsg, key) + case "mlFlowRegistryUri": + err = unpopulate(val, "MlFlowRegistryURI", &r.MlFlowRegistryURI) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess) + delete(rawMsg, key) + case "regionDetails": + err = unpopulate(val, "RegionDetails", &r.RegionDetails) + delete(rawMsg, key) + case "registryPrivateEndpointConnections": + err = unpopulate(val, "RegistryPrivateEndpointConnections", &r.RegistryPrivateEndpointConnections) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PATAuthTypeWorkspaceConnectionProperties. -func (p PATAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryRegionArmDetails. +func (r RegistryRegionArmDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["authType"] = ConnectionAuthTypePAT - populate(objectMap, "category", p.Category) - populate(objectMap, "credentials", p.Credentials) - populate(objectMap, "target", p.Target) - populate(objectMap, "value", p.Value) - populate(objectMap, "valueFormat", p.ValueFormat) + populate(objectMap, "acrDetails", r.AcrDetails) + populate(objectMap, "location", r.Location) + populate(objectMap, "storageAccountDetails", r.StorageAccountDetails) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PATAuthTypeWorkspaceConnectionProperties. -func (p *PATAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryRegionArmDetails. +func (r *RegistryRegionArmDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "authType": - err = unpopulate(val, "AuthType", &p.AuthType) - delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &p.Category) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &p.Credentials) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &p.Target) + case "acrDetails": + err = unpopulate(val, "AcrDetails", &r.AcrDetails) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &p.ValueFormat) + case "storageAccountDetails": + err = unpopulate(val, "StorageAccountDetails", &r.StorageAccountDetails) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PaginatedComputeResourcesList. -func (p PaginatedComputeResourcesList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryTrackedResourceArmPaginatedResult. +func (r RegistryTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PaginatedComputeResourcesList. -func (p *PaginatedComputeResourcesList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryTrackedResourceArmPaginatedResult. +func (r *RegistryTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &p.Value) + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialBatchDeployment. -func (p PartialBatchDeployment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Regression. +func (r Regression) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) + populate(objectMap, "cvSplitColumnNames", r.CvSplitColumnNames) + populate(objectMap, "featurizationSettings", r.FeaturizationSettings) + populate(objectMap, "fixedParameters", r.FixedParameters) + populate(objectMap, "limitSettings", r.LimitSettings) + populate(objectMap, "logVerbosity", r.LogVerbosity) + populate(objectMap, "nCrossValidations", r.NCrossValidations) + populate(objectMap, "primaryMetric", r.PrimaryMetric) + populate(objectMap, "searchSpace", r.SearchSpace) + populate(objectMap, "sweepSettings", r.SweepSettings) + populate(objectMap, "targetColumnName", r.TargetColumnName) + objectMap["taskType"] = TaskTypeRegression + populate(objectMap, "testData", r.TestData) + populate(objectMap, "testDataSize", r.TestDataSize) + populate(objectMap, "trainingData", r.TrainingData) + populate(objectMap, "trainingSettings", r.TrainingSettings) + populate(objectMap, "validationData", r.ValidationData) + populate(objectMap, "validationDataSize", r.ValidationDataSize) + populate(objectMap, "weightColumnName", r.WeightColumnName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialBatchDeployment. -func (p *PartialBatchDeployment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Regression. +func (r *Regression) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &p.Description) + case "cvSplitColumnNames": + err = unpopulate(val, "CvSplitColumnNames", &r.CvSplitColumnNames) + delete(rawMsg, key) + case "featurizationSettings": + err = unpopulate(val, "FeaturizationSettings", &r.FeaturizationSettings) + delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &r.FixedParameters) + delete(rawMsg, key) + case "limitSettings": + err = unpopulate(val, "LimitSettings", &r.LimitSettings) + delete(rawMsg, key) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &r.LogVerbosity) + delete(rawMsg, key) + case "nCrossValidations": + r.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) + delete(rawMsg, key) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &r.PrimaryMetric) + delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &r.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &r.SweepSettings) + delete(rawMsg, key) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &r.TargetColumnName) + delete(rawMsg, key) + case "taskType": + err = unpopulate(val, "TaskType", &r.TaskType) + delete(rawMsg, key) + case "testData": + err = unpopulate(val, "TestData", &r.TestData) + delete(rawMsg, key) + case "testDataSize": + err = unpopulate(val, "TestDataSize", &r.TestDataSize) + delete(rawMsg, key) + case "trainingData": + err = unpopulate(val, "TrainingData", &r.TrainingData) + delete(rawMsg, key) + case "trainingSettings": + err = unpopulate(val, "TrainingSettings", &r.TrainingSettings) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &r.ValidationData) + delete(rawMsg, key) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &r.ValidationDataSize) + delete(rawMsg, key) + case "weightColumnName": + err = unpopulate(val, "WeightColumnName", &r.WeightColumnName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. -func (p PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegressionModelPerformanceMetricThreshold. +func (r RegressionModelPerformanceMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "metric", r.Metric) + objectMap["modelType"] = MonitoringModelTypeRegression + populate(objectMap, "threshold", r.Threshold) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. -func (p *PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegressionModelPerformanceMetricThreshold. +func (r *RegressionModelPerformanceMetricThreshold) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "metric": + err = unpopulate(val, "Metric", &r.Metric) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "modelType": + err = unpopulate(val, "ModelType", &r.ModelType) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &r.Threshold) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialManagedServiceIdentity. -func (p PartialManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegressionTrainingSettings. +func (r RegressionTrainingSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", p.Type) - populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) + populate(objectMap, "allowedTrainingAlgorithms", r.AllowedTrainingAlgorithms) + populate(objectMap, "blockedTrainingAlgorithms", r.BlockedTrainingAlgorithms) + populate(objectMap, "enableDnnTraining", r.EnableDnnTraining) + populate(objectMap, "enableModelExplainability", r.EnableModelExplainability) + populate(objectMap, "enableOnnxCompatibleModels", r.EnableOnnxCompatibleModels) + populate(objectMap, "enableStackEnsemble", r.EnableStackEnsemble) + populate(objectMap, "enableVoteEnsemble", r.EnableVoteEnsemble) + populate(objectMap, "ensembleModelDownloadTimeout", r.EnsembleModelDownloadTimeout) + populate(objectMap, "stackEnsembleSettings", r.StackEnsembleSettings) + populate(objectMap, "trainingMode", r.TrainingMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialManagedServiceIdentity. -func (p *PartialManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegressionTrainingSettings. +func (r *RegressionTrainingSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &p.Type) + case "allowedTrainingAlgorithms": + err = unpopulate(val, "AllowedTrainingAlgorithms", &r.AllowedTrainingAlgorithms) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &p.UserAssignedIdentities) + case "blockedTrainingAlgorithms": + err = unpopulate(val, "BlockedTrainingAlgorithms", &r.BlockedTrainingAlgorithms) + delete(rawMsg, key) + case "enableDnnTraining": + err = unpopulate(val, "EnableDnnTraining", &r.EnableDnnTraining) + delete(rawMsg, key) + case "enableModelExplainability": + err = unpopulate(val, "EnableModelExplainability", &r.EnableModelExplainability) + delete(rawMsg, key) + case "enableOnnxCompatibleModels": + err = unpopulate(val, "EnableOnnxCompatibleModels", &r.EnableOnnxCompatibleModels) + delete(rawMsg, key) + case "enableStackEnsemble": + err = unpopulate(val, "EnableStackEnsemble", &r.EnableStackEnsemble) + delete(rawMsg, key) + case "enableVoteEnsemble": + err = unpopulate(val, "EnableVoteEnsemble", &r.EnableVoteEnsemble) + delete(rawMsg, key) + case "ensembleModelDownloadTimeout": + err = unpopulate(val, "EnsembleModelDownloadTimeout", &r.EnsembleModelDownloadTimeout) + delete(rawMsg, key) + case "stackEnsembleSettings": + err = unpopulate(val, "StackEnsembleSettings", &r.StackEnsembleSettings) + delete(rawMsg, key) + case "trainingMode": + err = unpopulate(val, "TrainingMode", &r.TrainingMode) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResource. -func (p PartialMinimalTrackedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RequestConfiguration. +func (r RequestConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "maxConcurrentRequestsPerInstance", r.MaxConcurrentRequestsPerInstance) + populate(objectMap, "requestTimeout", r.RequestTimeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResource. -func (p *PartialMinimalTrackedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestConfiguration. +func (r *RequestConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "maxConcurrentRequestsPerInstance": + err = unpopulate(val, "MaxConcurrentRequestsPerInstance", &r.MaxConcurrentRequestsPerInstance) + delete(rawMsg, key) + case "requestTimeout": + err = unpopulate(val, "RequestTimeout", &r.RequestTimeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithIdentity. -func (p PartialMinimalTrackedResourceWithIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RequestLogging. +func (r RequestLogging) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "captureHeaders", r.CaptureHeaders) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResourceWithIdentity. -func (p *PartialMinimalTrackedResourceWithIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestLogging. +func (r *RequestLogging) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "captureHeaders": + err = unpopulate(val, "CaptureHeaders", &r.CaptureHeaders) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithSKU. -func (p PartialMinimalTrackedResourceWithSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResizeSchema. +func (r ResizeSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "targetVMSize", r.TargetVMSize) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialMinimalTrackedResourceWithSKU. -func (p *PartialMinimalTrackedResourceWithSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResizeSchema. +func (r *ResizeSchema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "sku": - err = unpopulate(val, "SKU", &p.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "targetVMSize": + err = unpopulate(val, "TargetVMSize", &r.TargetVMSize) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PartialSKU. -func (p PartialSKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", p.Capacity) - populate(objectMap, "family", p.Family) - populate(objectMap, "name", p.Name) - populate(objectMap, "size", p.Size) - populate(objectMap, "tier", p.Tier) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PartialSKU. -func (p *PartialSKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &p.Capacity) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &p.Family) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &p.Size) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &p.Tier) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Password. -func (p Password) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceBase. +func (r ResourceBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "value", p.Value) + populate(objectMap, "description", r.Description) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Password. -func (p *Password) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceBase. +func (r *ResourceBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) + case "description": + err = unpopulate(val, "Description", &r.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PersonalComputeInstanceSettings. -func (p PersonalComputeInstanceSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceConfiguration. +func (r ResourceConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assignedUser", p.AssignedUser) + populate(objectMap, "instanceCount", r.InstanceCount) + populate(objectMap, "instanceType", r.InstanceType) + populate(objectMap, "locations", r.Locations) + populate(objectMap, "maxInstanceCount", r.MaxInstanceCount) + populate(objectMap, "properties", r.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PersonalComputeInstanceSettings. -func (p *PersonalComputeInstanceSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceConfiguration. +func (r *ResourceConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "assignedUser": - err = unpopulate(val, "AssignedUser", &p.AssignedUser) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &r.InstanceCount) + delete(rawMsg, key) + case "instanceType": + err = unpopulate(val, "InstanceType", &r.InstanceType) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &r.Locations) + delete(rawMsg, key) + case "maxInstanceCount": + err = unpopulate(val, "MaxInstanceCount", &r.MaxInstanceCount) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PipelineJob. -func (p PipelineJob) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceID. +func (r ResourceID) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "componentId", p.ComponentID) - populate(objectMap, "computeId", p.ComputeID) - populate(objectMap, "description", p.Description) - populate(objectMap, "displayName", p.DisplayName) - populate(objectMap, "experimentName", p.ExperimentName) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "inputs", p.Inputs) - populate(objectMap, "isArchived", p.IsArchived) - objectMap["jobType"] = JobTypePipeline - populate(objectMap, "jobs", p.Jobs) - populate(objectMap, "outputs", p.Outputs) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "services", p.Services) - populateAny(objectMap, "settings", p.Settings) - populate(objectMap, "sourceJobId", p.SourceJobID) - populate(objectMap, "status", p.Status) - populate(objectMap, "tags", p.Tags) + populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineJob. -func (p *PipelineJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceID. +func (r *ResourceID) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "componentId": - err = unpopulate(val, "ComponentID", &p.ComponentID) - delete(rawMsg, key) - case "computeId": - err = unpopulate(val, "ComputeID", &p.ComputeID) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &p.DisplayName) - delete(rawMsg, key) - case "experimentName": - err = unpopulate(val, "ExperimentName", &p.ExperimentName) - delete(rawMsg, key) - case "identity": - p.Identity, err = unmarshalIdentityConfigurationClassification(val) - delete(rawMsg, key) - case "inputs": - p.Inputs, err = unmarshalJobInputClassificationMap(val) - delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &p.IsArchived) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &p.JobType) - delete(rawMsg, key) - case "jobs": - err = unpopulate(val, "Jobs", &p.Jobs) - delete(rawMsg, key) - case "outputs": - p.Outputs, err = unmarshalJobOutputClassificationMap(val) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &p.Services) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &p.Settings) - delete(rawMsg, key) - case "sourceJobId": - err = unpopulate(val, "SourceJobID", &p.SourceJobID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceName. +func (r ResourceName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "subnetArmId", p.SubnetArmID) + populate(objectMap, "localizedValue", r.LocalizedValue) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceName. +func (r *ResourceName) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &r.LocalizedValue) delete(rawMsg, key) - case "subnetArmId": - err = unpopulate(val, "SubnetArmID", &p.SubnetArmID) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceQuota. +func (r ResourceQuota) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "amlWorkspaceLocation", r.AmlWorkspaceLocation) + populate(objectMap, "id", r.ID) + populate(objectMap, "limit", r.Limit) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + populate(objectMap, "unit", r.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceQuota. +func (r *ResourceQuota) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "amlWorkspaceLocation": + err = unpopulate(val, "AmlWorkspaceLocation", &r.AmlWorkspaceLocation) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + case "limit": + err = unpopulate(val, "Limit", &r.Limit) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &p.SKU) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RollingInputData. +func (r RollingInputData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) + populate(objectMap, "columns", r.Columns) + populate(objectMap, "dataContext", r.DataContext) + objectMap["inputDataType"] = MonitoringInputDataTypeRolling + populate(objectMap, "jobInputType", r.JobInputType) + populate(objectMap, "preprocessingComponentId", r.PreprocessingComponentID) + populate(objectMap, "uri", r.URI) + populate(objectMap, "windowOffset", r.WindowOffset) + populate(objectMap, "windowSize", r.WindowSize) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RollingInputData. +func (r *RollingInputData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "columns": + err = unpopulate(val, "Columns", &r.Columns) + delete(rawMsg, key) + case "dataContext": + err = unpopulate(val, "DataContext", &r.DataContext) + delete(rawMsg, key) + case "inputDataType": + err = unpopulate(val, "InputDataType", &r.InputDataType) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &r.JobInputType) + delete(rawMsg, key) + case "preprocessingComponentId": + err = unpopulate(val, "PreprocessingComponentID", &r.PreprocessingComponentID) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &r.URI) + delete(rawMsg, key) + case "windowOffset": + err = unpopulate(val, "WindowOffset", &r.WindowOffset) + delete(rawMsg, key) + case "windowSize": + err = unpopulate(val, "WindowSize", &r.WindowSize) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Route. +func (r Route) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "path", r.Path) + populate(objectMap, "port", r.Port) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Route. +func (r *Route) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "path": + err = unpopulate(val, "Path", &r.Path) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "port": + err = unpopulate(val, "Port", &r.Port) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SASAuthTypeWorkspaceConnectionProperties. +func (s SASAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + objectMap["authType"] = ConnectionAuthTypeSAS + populate(objectMap, "category", s.Category) + populate(objectMap, "createdByWorkspaceArmId", s.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", s.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime) + populate(objectMap, "isSharedToAll", s.IsSharedToAll) + populateAny(objectMap, "metadata", s.Metadata) + populate(objectMap, "target", s.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SASAuthTypeWorkspaceConnectionProperties. +func (s *SASAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) + case "authType": + err = unpopulate(val, "AuthType", &s.AuthType) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + case "category": + err = unpopulate(val, "Category", &s.Category) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &s.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "credentials": + err = unpopulate(val, "Credentials", &s.Credentials) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &p.SKU) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &s.IsSharedToAll) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "target": + err = unpopulate(val, "Target", &s.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SASCredential. +func (s SASCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) + objectMap["credentialType"] = DataReferenceCredentialTypeSAS + populate(objectMap, "sasUri", s.SasURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SASCredential. +func (s *SASCredential) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "credentialType": + err = unpopulate(val, "CredentialType", &s.CredentialType) + delete(rawMsg, key) + case "sasUri": + err = unpopulate(val, "SasURI", &s.SasURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SASCredentialDto. +func (s SASCredentialDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + objectMap["credentialType"] = PendingUploadCredentialTypeSAS + populate(objectMap, "sasUri", s.SasURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SASCredentialDto. +func (s *SASCredentialDto) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "credentialType": + err = unpopulate(val, "CredentialType", &s.CredentialType) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "sasUri": + err = unpopulate(val, "SasURI", &s.SasURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "family": + err = unpopulate(val, "Family", &s.Family) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProbeSettings. -func (p ProbeSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKUCapacity. +func (s SKUCapacity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failureThreshold", p.FailureThreshold) - populate(objectMap, "initialDelay", p.InitialDelay) - populate(objectMap, "period", p.Period) - populate(objectMap, "successThreshold", p.SuccessThreshold) - populate(objectMap, "timeout", p.Timeout) + populate(objectMap, "default", s.Default) + populate(objectMap, "maximum", s.Maximum) + populate(objectMap, "minimum", s.Minimum) + populate(objectMap, "scaleType", s.ScaleType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProbeSettings. -func (p *ProbeSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. +func (s *SKUCapacity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "failureThreshold": - err = unpopulate(val, "FailureThreshold", &p.FailureThreshold) - delete(rawMsg, key) - case "initialDelay": - err = unpopulate(val, "InitialDelay", &p.InitialDelay) + case "default": + err = unpopulate(val, "Default", &s.Default) delete(rawMsg, key) - case "period": - err = unpopulate(val, "Period", &p.Period) + case "maximum": + err = unpopulate(val, "Maximum", &s.Maximum) delete(rawMsg, key) - case "successThreshold": - err = unpopulate(val, "SuccessThreshold", &p.SuccessThreshold) + case "minimum": + err = unpopulate(val, "Minimum", &s.Minimum) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &p.Timeout) + case "scaleType": + err = unpopulate(val, "ScaleType", &s.ScaleType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PyTorch. -func (p PyTorch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKUResource. +func (s SKUResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["distributionType"] = DistributionTypePyTorch - populate(objectMap, "processCountPerInstance", p.ProcessCountPerInstance) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "sku", s.SKU) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PyTorch. -func (p *PyTorch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUResource. +func (s *SKUResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "distributionType": - err = unpopulate(val, "DistributionType", &p.DistributionType) + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) - case "processCountPerInstance": - err = unpopulate(val, "ProcessCountPerInstance", &p.ProcessCountPerInstance) + case "resourceType": + err = unpopulate(val, "ResourceType", &s.ResourceType) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaBaseProperties. -func (q QuotaBaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKUResourceArmPaginatedResult. +func (s SKUResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", q.ID) - populate(objectMap, "limit", q.Limit) - populate(objectMap, "type", q.Type) - populate(objectMap, "unit", q.Unit) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBaseProperties. -func (q *QuotaBaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUResourceArmPaginatedResult. +func (s *SKUResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &q.ID) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &q.Limit) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &q.Type) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &q.Unit) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaUpdateParameters. -func (q QuotaUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKUSetting. +func (s SKUSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", q.Location) - populate(objectMap, "value", q.Value) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUpdateParameters. -func (q *QuotaUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUSetting. +func (s *SKUSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &q.Location) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RandomSamplingAlgorithm. -func (r RandomSamplingAlgorithm) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SSLConfiguration. +func (s SSLConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "rule", r.Rule) - objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeRandom - populate(objectMap, "seed", r.Seed) + populate(objectMap, "cert", s.Cert) + populate(objectMap, "cname", s.Cname) + populate(objectMap, "key", s.Key) + populate(objectMap, "leafDomainLabel", s.LeafDomainLabel) + populate(objectMap, "overwriteExistingDomain", s.OverwriteExistingDomain) + populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RandomSamplingAlgorithm. -func (r *RandomSamplingAlgorithm) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SSLConfiguration. +func (s *SSLConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "rule": - err = unpopulate(val, "Rule", &r.Rule) + case "cert": + err = unpopulate(val, "Cert", &s.Cert) delete(rawMsg, key) - case "samplingAlgorithmType": - err = unpopulate(val, "SamplingAlgorithmType", &r.SamplingAlgorithmType) + case "cname": + err = unpopulate(val, "Cname", &s.Cname) delete(rawMsg, key) - case "seed": - err = unpopulate(val, "Seed", &r.Seed) + case "key": + err = unpopulate(val, "Key", &s.Key) + delete(rawMsg, key) + case "leafDomainLabel": + err = unpopulate(val, "LeafDomainLabel", &s.LeafDomainLabel) + delete(rawMsg, key) + case "overwriteExistingDomain": + err = unpopulate(val, "OverwriteExistingDomain", &s.OverwriteExistingDomain) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecurrenceSchedule. -func (r RecurrenceSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SamplingAlgorithm. +func (s SamplingAlgorithm) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hours", r.Hours) - populate(objectMap, "minutes", r.Minutes) - populate(objectMap, "monthDays", r.MonthDays) - populate(objectMap, "weekDays", r.WeekDays) + objectMap["samplingAlgorithmType"] = s.SamplingAlgorithmType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecurrenceSchedule. -func (r *RecurrenceSchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SamplingAlgorithm. +func (s *SamplingAlgorithm) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "hours": - err = unpopulate(val, "Hours", &r.Hours) - delete(rawMsg, key) - case "minutes": - err = unpopulate(val, "Minutes", &r.Minutes) - delete(rawMsg, key) - case "monthDays": - err = unpopulate(val, "MonthDays", &r.MonthDays) - delete(rawMsg, key) - case "weekDays": - err = unpopulate(val, "WeekDays", &r.WeekDays) + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &s.SamplingAlgorithmType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecurrenceTrigger. -func (r RecurrenceTrigger) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SasDatastoreCredentials. +func (s SasDatastoreCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endTime", r.EndTime) - populate(objectMap, "frequency", r.Frequency) - populate(objectMap, "interval", r.Interval) - populate(objectMap, "schedule", r.Schedule) - populate(objectMap, "startTime", r.StartTime) - populate(objectMap, "timeZone", r.TimeZone) - objectMap["triggerType"] = TriggerTypeRecurrence + objectMap["credentialsType"] = CredentialsTypeSas + populate(objectMap, "secrets", s.Secrets) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecurrenceTrigger. -func (r *RecurrenceTrigger) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SasDatastoreCredentials. +func (s *SasDatastoreCredentials) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulate(val, "EndTime", &r.EndTime) - delete(rawMsg, key) - case "frequency": - err = unpopulate(val, "Frequency", &r.Frequency) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &r.Interval) - delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &r.Schedule) - delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &r.TimeZone) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &s.CredentialsType) delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &r.TriggerType) + case "secrets": + err = unpopulate(val, "Secrets", &s.Secrets) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegenerateEndpointKeysRequest. -func (r RegenerateEndpointKeysRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SasDatastoreSecrets. +func (s SasDatastoreSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyType", r.KeyType) - populate(objectMap, "keyValue", r.KeyValue) + populate(objectMap, "sasToken", s.SasToken) + objectMap["secretsType"] = SecretsTypeSas return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateEndpointKeysRequest. -func (r *RegenerateEndpointKeysRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SasDatastoreSecrets. +func (s *SasDatastoreSecrets) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "keyType": - err = unpopulate(val, "KeyType", &r.KeyType) + case "sasToken": + err = unpopulate(val, "SasToken", &s.SasToken) delete(rawMsg, key) - case "keyValue": - err = unpopulate(val, "KeyValue", &r.KeyValue) + case "secretsType": + err = unpopulate(val, "SecretsType", &s.SecretsType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryListCredentialsResult. -func (r RegistryListCredentialsResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScaleSettings. +func (s ScaleSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", r.Location) - populate(objectMap, "passwords", r.Passwords) - populate(objectMap, "username", r.Username) + populate(objectMap, "maxNodeCount", s.MaxNodeCount) + populate(objectMap, "minNodeCount", s.MinNodeCount) + populate(objectMap, "nodeIdleTimeBeforeScaleDown", s.NodeIdleTimeBeforeScaleDown) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListCredentialsResult. -func (r *RegistryListCredentialsResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleSettings. +func (s *ScaleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &r.Location) + case "maxNodeCount": + err = unpopulate(val, "MaxNodeCount", &s.MaxNodeCount) delete(rawMsg, key) - case "passwords": - err = unpopulate(val, "Passwords", &r.Passwords) + case "minNodeCount": + err = unpopulate(val, "MinNodeCount", &s.MinNodeCount) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &r.Username) + case "nodeIdleTimeBeforeScaleDown": + err = unpopulate(val, "NodeIdleTimeBeforeScaleDown", &s.NodeIdleTimeBeforeScaleDown) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Regression. -func (r Regression) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cvSplitColumnNames", r.CvSplitColumnNames) - populate(objectMap, "featurizationSettings", r.FeaturizationSettings) - populate(objectMap, "limitSettings", r.LimitSettings) - populate(objectMap, "logVerbosity", r.LogVerbosity) - populate(objectMap, "nCrossValidations", r.NCrossValidations) - populate(objectMap, "primaryMetric", r.PrimaryMetric) - populate(objectMap, "targetColumnName", r.TargetColumnName) - objectMap["taskType"] = TaskTypeRegression - populate(objectMap, "testData", r.TestData) - populate(objectMap, "testDataSize", r.TestDataSize) - populate(objectMap, "trainingData", r.TrainingData) - populate(objectMap, "trainingSettings", r.TrainingSettings) - populate(objectMap, "validationData", r.ValidationData) - populate(objectMap, "validationDataSize", r.ValidationDataSize) - populate(objectMap, "weightColumnName", r.WeightColumnName) +// MarshalJSON implements the json.Marshaller interface for type ScaleSettingsInformation. +func (s ScaleSettingsInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scaleSettings", s.ScaleSettings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Regression. -func (r *Regression) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleSettingsInformation. +func (s *ScaleSettingsInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "cvSplitColumnNames": - err = unpopulate(val, "CvSplitColumnNames", &r.CvSplitColumnNames) - delete(rawMsg, key) - case "featurizationSettings": - err = unpopulate(val, "FeaturizationSettings", &r.FeaturizationSettings) - delete(rawMsg, key) - case "limitSettings": - err = unpopulate(val, "LimitSettings", &r.LimitSettings) - delete(rawMsg, key) - case "logVerbosity": - err = unpopulate(val, "LogVerbosity", &r.LogVerbosity) - delete(rawMsg, key) - case "nCrossValidations": - r.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) - delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &r.PrimaryMetric) - delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &r.TargetColumnName) - delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &r.TaskType) - delete(rawMsg, key) - case "testData": - err = unpopulate(val, "TestData", &r.TestData) - delete(rawMsg, key) - case "testDataSize": - err = unpopulate(val, "TestDataSize", &r.TestDataSize) - delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &r.TrainingData) - delete(rawMsg, key) - case "trainingSettings": - err = unpopulate(val, "TrainingSettings", &r.TrainingSettings) - delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &r.ValidationData) - delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &r.ValidationDataSize) - delete(rawMsg, key) - case "weightColumnName": - err = unpopulate(val, "WeightColumnName", &r.WeightColumnName) + case "scaleSettings": + err = unpopulate(val, "ScaleSettings", &s.ScaleSettings) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegressionTrainingSettings. -func (r RegressionTrainingSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTrainingAlgorithms", r.AllowedTrainingAlgorithms) - populate(objectMap, "blockedTrainingAlgorithms", r.BlockedTrainingAlgorithms) - populate(objectMap, "enableDnnTraining", r.EnableDnnTraining) - populate(objectMap, "enableModelExplainability", r.EnableModelExplainability) - populate(objectMap, "enableOnnxCompatibleModels", r.EnableOnnxCompatibleModels) - populate(objectMap, "enableStackEnsemble", r.EnableStackEnsemble) - populate(objectMap, "enableVoteEnsemble", r.EnableVoteEnsemble) - populate(objectMap, "ensembleModelDownloadTimeout", r.EnsembleModelDownloadTimeout) - populate(objectMap, "stackEnsembleSettings", r.StackEnsembleSettings) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegressionTrainingSettings. -func (r *RegressionTrainingSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. +func (s *Schedule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "allowedTrainingAlgorithms": - err = unpopulate(val, "AllowedTrainingAlgorithms", &r.AllowedTrainingAlgorithms) - delete(rawMsg, key) - case "blockedTrainingAlgorithms": - err = unpopulate(val, "BlockedTrainingAlgorithms", &r.BlockedTrainingAlgorithms) - delete(rawMsg, key) - case "enableDnnTraining": - err = unpopulate(val, "EnableDnnTraining", &r.EnableDnnTraining) - delete(rawMsg, key) - case "enableModelExplainability": - err = unpopulate(val, "EnableModelExplainability", &r.EnableModelExplainability) - delete(rawMsg, key) - case "enableOnnxCompatibleModels": - err = unpopulate(val, "EnableOnnxCompatibleModels", &r.EnableOnnxCompatibleModels) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "enableStackEnsemble": - err = unpopulate(val, "EnableStackEnsemble", &r.EnableStackEnsemble) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "enableVoteEnsemble": - err = unpopulate(val, "EnableVoteEnsemble", &r.EnableVoteEnsemble) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "ensembleModelDownloadTimeout": - err = unpopulate(val, "EnsembleModelDownloadTimeout", &r.EnsembleModelDownloadTimeout) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "stackEnsembleSettings": - err = unpopulate(val, "StackEnsembleSettings", &r.StackEnsembleSettings) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScheduleActionBase. +func (s ScheduleActionBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) + objectMap["actionType"] = s.ActionType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleActionBase. +func (s *ScheduleActionBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "actionType": + err = unpopulate(val, "ActionType", &s.ActionType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceBase. -func (r ResourceBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScheduleBase. +func (s ScheduleBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) + populate(objectMap, "id", s.ID) + populate(objectMap, "provisioningStatus", s.ProvisioningStatus) + populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceBase. -func (r *ResourceBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleBase. +func (s *ScheduleBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "provisioningStatus": + err = unpopulate(val, "ProvisioningStatus", &s.ProvisioningStatus) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceConfiguration. -func (r ResourceConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScheduleProperties. +func (s ScheduleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "instanceCount", r.InstanceCount) - populate(objectMap, "instanceType", r.InstanceType) - populate(objectMap, "properties", r.Properties) + populate(objectMap, "action", s.Action) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "isEnabled", s.IsEnabled) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "trigger", s.Trigger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceConfiguration. -func (r *ResourceConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties. +func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "instanceCount": - err = unpopulate(val, "InstanceCount", &r.InstanceCount) + case "action": + s.Action, err = unmarshalScheduleActionBaseClassification(val) delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &r.InstanceType) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &s.IsEnabled) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &r.Properties) + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "trigger": + s.Trigger, err = unmarshalTriggerBaseClassification(val) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceID. -func (r ResourceID) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScheduleResourceArmPaginatedResult. +func (s ScheduleResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceID. -func (r *ResourceID) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleResourceArmPaginatedResult. +func (s *ScheduleResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceName. -func (r ResourceName) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScriptReference. +func (s ScriptReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "localizedValue", r.LocalizedValue) - populate(objectMap, "value", r.Value) + populate(objectMap, "scriptArguments", s.ScriptArguments) + populate(objectMap, "scriptData", s.ScriptData) + populate(objectMap, "scriptSource", s.ScriptSource) + populate(objectMap, "timeout", s.Timeout) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceName. -func (r *ResourceName) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptReference. +func (s *ScriptReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &r.LocalizedValue) + case "scriptArguments": + err = unpopulate(val, "ScriptArguments", &s.ScriptArguments) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "scriptData": + err = unpopulate(val, "ScriptData", &s.ScriptData) + delete(rawMsg, key) + case "scriptSource": + err = unpopulate(val, "ScriptSource", &s.ScriptSource) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &s.Timeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceQuota. -func (r ResourceQuota) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScriptsToExecute. +func (s ScriptsToExecute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "amlWorkspaceLocation", r.AmlWorkspaceLocation) - populate(objectMap, "id", r.ID) - populate(objectMap, "limit", r.Limit) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) - populate(objectMap, "unit", r.Unit) + populate(objectMap, "creationScript", s.CreationScript) + populate(objectMap, "startupScript", s.StartupScript) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceQuota. -func (r *ResourceQuota) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptsToExecute. +func (s *ScriptsToExecute) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "amlWorkspaceLocation": - err = unpopulate(val, "AmlWorkspaceLocation", &r.AmlWorkspaceLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &r.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "creationScript": + err = unpopulate(val, "CreationScript", &s.CreationScript) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) + case "startupScript": + err = unpopulate(val, "StartupScript", &s.StartupScript) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Route. -func (r Route) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Seasonality. +func (s Seasonality) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "path", r.Path) - populate(objectMap, "port", r.Port) + objectMap["mode"] = s.Mode return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Route. -func (r *Route) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Seasonality. +func (s *Seasonality) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "path": - err = unpopulate(val, "Path", &r.Path) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &r.Port) + case "mode": + err = unpopulate(val, "Mode", &s.Mode) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SASAuthTypeWorkspaceConnectionProperties. -func (s SASAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecretConfiguration. +func (s SecretConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["authType"] = ConnectionAuthTypeSAS - populate(objectMap, "category", s.Category) - populate(objectMap, "credentials", s.Credentials) - populate(objectMap, "target", s.Target) - populate(objectMap, "value", s.Value) - populate(objectMap, "valueFormat", s.ValueFormat) + populate(objectMap, "uri", s.URI) + populate(objectMap, "workspaceSecretName", s.WorkspaceSecretName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SASAuthTypeWorkspaceConnectionProperties. -func (s *SASAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretConfiguration. +func (s *SecretConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12280,23 +21600,11 @@ func (s *SASAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "authType": - err = unpopulate(val, "AuthType", &s.AuthType) - delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &s.Category) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &s.Credentials) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &s.Target) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "uri": + err = unpopulate(val, "URI", &s.URI) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &s.ValueFormat) + case "workspaceSecretName": + err = unpopulate(val, "WorkspaceSecretName", &s.WorkspaceSecretName) delete(rawMsg, key) } if err != nil { @@ -12306,19 +21614,16 @@ func (s *SASAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessComputeSettings. +func (s ServerlessComputeSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "family", s.Family) - populate(objectMap, "name", s.Name) - populate(objectMap, "size", s.Size) - populate(objectMap, "tier", s.Tier) + populate(objectMap, "serverlessComputeCustomSubnet", s.ServerlessComputeCustomSubnet) + populate(objectMap, "serverlessComputeNoPublicIP", s.ServerlessComputeNoPublicIP) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessComputeSettings. +func (s *ServerlessComputeSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12326,20 +21631,11 @@ func (s *SKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &s.Family) + case "serverlessComputeCustomSubnet": + err = unpopulate(val, "ServerlessComputeCustomSubnet", &s.ServerlessComputeCustomSubnet) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &s.Size) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) + case "serverlessComputeNoPublicIP": + err = unpopulate(val, "ServerlessComputeNoPublicIP", &s.ServerlessComputeNoPublicIP) delete(rawMsg, key) } if err != nil { @@ -12349,18 +21645,24 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUCapacity. -func (s SKUCapacity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessEndpoint. +func (s ServerlessEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "default", s.Default) - populate(objectMap, "maximum", s.Maximum) - populate(objectMap, "minimum", s.Minimum) - populate(objectMap, "scaleType", s.ScaleType) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. -func (s *SKUCapacity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessEndpoint. +func (s *ServerlessEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12368,17 +21670,35 @@ func (s *SKUCapacity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "default": - err = unpopulate(val, "Default", &s.Default) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &s.Maximum) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &s.Minimum) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &s.ScaleType) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -12388,17 +21708,16 @@ func (s *SKUCapacity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUResource. -func (s SKUResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessEndpointCapacityReservation. +func (s ServerlessEndpointCapacityReservation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "resourceType", s.ResourceType) - populate(objectMap, "sku", s.SKU) + populate(objectMap, "capacityReservationGroupId", s.CapacityReservationGroupID) + populate(objectMap, "endpointReservedCapacity", s.EndpointReservedCapacity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUResource. -func (s *SKUResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessEndpointCapacityReservation. +func (s *ServerlessEndpointCapacityReservation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12406,14 +21725,11 @@ func (s *SKUResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) + case "capacityReservationGroupId": + err = unpopulate(val, "CapacityReservationGroupID", &s.CapacityReservationGroupID) delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &s.ResourceType) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) + case "endpointReservedCapacity": + err = unpopulate(val, "EndpointReservedCapacity", &s.EndpointReservedCapacity) delete(rawMsg, key) } if err != nil { @@ -12423,16 +21739,19 @@ func (s *SKUResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUResourceArmPaginatedResult. -func (s SKUResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessEndpointProperties. +func (s ServerlessEndpointProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "authMode", s.AuthMode) + populate(objectMap, "capacityReservation", s.CapacityReservation) + populate(objectMap, "inferenceEndpoint", s.InferenceEndpoint) + populate(objectMap, "offer", s.Offer) + populate(objectMap, "provisioningState", s.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUResourceArmPaginatedResult. -func (s *SKUResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessEndpointProperties. +func (s *ServerlessEndpointProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12440,11 +21759,20 @@ func (s *SKUResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "authMode": + err = unpopulate(val, "AuthMode", &s.AuthMode) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "capacityReservation": + err = unpopulate(val, "CapacityReservation", &s.CapacityReservation) + delete(rawMsg, key) + case "inferenceEndpoint": + err = unpopulate(val, "InferenceEndpoint", &s.InferenceEndpoint) + delete(rawMsg, key) + case "offer": + err = unpopulate(val, "Offer", &s.Offer) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -12454,16 +21782,15 @@ func (s *SKUResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUSetting. -func (s SKUSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessEndpointStatus. +func (s ServerlessEndpointStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) + populate(objectMap, "metrics", s.Metrics) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUSetting. -func (s *SKUSetting) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessEndpointStatus. +func (s *ServerlessEndpointStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12471,11 +21798,8 @@ func (s *SKUSetting) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) + case "metrics": + err = unpopulate(val, "Metrics", &s.Metrics) delete(rawMsg, key) } if err != nil { @@ -12485,20 +21809,16 @@ func (s *SKUSetting) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SSLConfiguration. -func (s SSLConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessEndpointTrackedResourceArmPaginatedResult. +func (s ServerlessEndpointTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cert", s.Cert) - populate(objectMap, "cname", s.Cname) - populate(objectMap, "key", s.Key) - populate(objectMap, "leafDomainLabel", s.LeafDomainLabel) - populate(objectMap, "overwriteExistingDomain", s.OverwriteExistingDomain) - populate(objectMap, "status", s.Status) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SSLConfiguration. -func (s *SSLConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessEndpointTrackedResourceArmPaginatedResult. +func (s *ServerlessEndpointTrackedResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12506,23 +21826,11 @@ func (s *SSLConfiguration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "cert": - err = unpopulate(val, "Cert", &s.Cert) - delete(rawMsg, key) - case "cname": - err = unpopulate(val, "Cname", &s.Cname) - delete(rawMsg, key) - case "key": - err = unpopulate(val, "Key", &s.Key) - delete(rawMsg, key) - case "leafDomainLabel": - err = unpopulate(val, "LeafDomainLabel", &s.LeafDomainLabel) - delete(rawMsg, key) - case "overwriteExistingDomain": - err = unpopulate(val, "OverwriteExistingDomain", &s.OverwriteExistingDomain) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -12532,15 +21840,16 @@ func (s *SSLConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SamplingAlgorithm. -func (s SamplingAlgorithm) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessInferenceEndpoint. +func (s ServerlessInferenceEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["samplingAlgorithmType"] = s.SamplingAlgorithmType + populate(objectMap, "headers", s.Headers) + populate(objectMap, "uri", s.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SamplingAlgorithm. -func (s *SamplingAlgorithm) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessInferenceEndpoint. +func (s *ServerlessInferenceEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12548,8 +21857,11 @@ func (s *SamplingAlgorithm) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "samplingAlgorithmType": - err = unpopulate(val, "SamplingAlgorithmType", &s.SamplingAlgorithmType) + case "headers": + err = unpopulate(val, "Headers", &s.Headers) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &s.URI) delete(rawMsg, key) } if err != nil { @@ -12559,16 +21871,16 @@ func (s *SamplingAlgorithm) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SasDatastoreCredentials. -func (s SasDatastoreCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServerlessOffer. +func (s ServerlessOffer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["credentialsType"] = CredentialsTypeSas - populate(objectMap, "secrets", s.Secrets) + populate(objectMap, "offerName", s.OfferName) + populate(objectMap, "publisher", s.Publisher) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SasDatastoreCredentials. -func (s *SasDatastoreCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessOffer. +func (s *ServerlessOffer) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12576,11 +21888,11 @@ func (s *SasDatastoreCredentials) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "credentialsType": - err = unpopulate(val, "CredentialsType", &s.CredentialsType) + case "offerName": + err = unpopulate(val, "OfferName", &s.OfferName) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) + case "publisher": + err = unpopulate(val, "Publisher", &s.Publisher) delete(rawMsg, key) } if err != nil { @@ -12590,16 +21902,15 @@ func (s *SasDatastoreCredentials) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SasDatastoreSecrets. -func (s SasDatastoreSecrets) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceManagedResourcesSettings. +func (s ServiceManagedResourcesSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sasToken", s.SasToken) - objectMap["secretsType"] = SecretsTypeSas + populate(objectMap, "cosmosDb", s.CosmosDb) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SasDatastoreSecrets. -func (s *SasDatastoreSecrets) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceManagedResourcesSettings. +func (s *ServiceManagedResourcesSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12607,11 +21918,8 @@ func (s *SasDatastoreSecrets) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "sasToken": - err = unpopulate(val, "SasToken", &s.SasToken) - delete(rawMsg, key) - case "secretsType": - err = unpopulate(val, "SecretsType", &s.SecretsType) + case "cosmosDb": + err = unpopulate(val, "CosmosDb", &s.CosmosDb) delete(rawMsg, key) } if err != nil { @@ -12621,17 +21929,22 @@ func (s *SasDatastoreSecrets) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScaleSettings. -func (s ScaleSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServicePrincipalAuthTypeWorkspaceConnectionProperties. +func (s ServicePrincipalAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxNodeCount", s.MaxNodeCount) - populate(objectMap, "minNodeCount", s.MinNodeCount) - populate(objectMap, "nodeIdleTimeBeforeScaleDown", s.NodeIdleTimeBeforeScaleDown) + objectMap["authType"] = ConnectionAuthTypeServicePrincipal + populate(objectMap, "category", s.Category) + populate(objectMap, "createdByWorkspaceArmId", s.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", s.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime) + populate(objectMap, "isSharedToAll", s.IsSharedToAll) + populateAny(objectMap, "metadata", s.Metadata) + populate(objectMap, "target", s.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleSettings. -func (s *ScaleSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalAuthTypeWorkspaceConnectionProperties. +func (s *ServicePrincipalAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12639,14 +21952,29 @@ func (s *ScaleSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "maxNodeCount": - err = unpopulate(val, "MaxNodeCount", &s.MaxNodeCount) + case "authType": + err = unpopulate(val, "AuthType", &s.AuthType) delete(rawMsg, key) - case "minNodeCount": - err = unpopulate(val, "MinNodeCount", &s.MinNodeCount) + case "category": + err = unpopulate(val, "Category", &s.Category) delete(rawMsg, key) - case "nodeIdleTimeBeforeScaleDown": - err = unpopulate(val, "NodeIdleTimeBeforeScaleDown", &s.NodeIdleTimeBeforeScaleDown) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &s.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &s.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &s.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &s.Target) delete(rawMsg, key) } if err != nil { @@ -12656,15 +21984,20 @@ func (s *ScaleSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScaleSettingsInformation. -func (s ScaleSettingsInformation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServicePrincipalDatastoreCredentials. +func (s ServicePrincipalDatastoreCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "scaleSettings", s.ScaleSettings) + populate(objectMap, "authorityUrl", s.AuthorityURL) + populate(objectMap, "clientId", s.ClientID) + objectMap["credentialsType"] = CredentialsTypeServicePrincipal + populate(objectMap, "resourceUrl", s.ResourceURL) + populate(objectMap, "secrets", s.Secrets) + populate(objectMap, "tenantId", s.TenantID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleSettingsInformation. -func (s *ScaleSettingsInformation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDatastoreCredentials. +func (s *ServicePrincipalDatastoreCredentials) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12672,8 +22005,23 @@ func (s *ScaleSettingsInformation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "scaleSettings": - err = unpopulate(val, "ScaleSettings", &s.ScaleSettings) + case "authorityUrl": + err = unpopulate(val, "AuthorityURL", &s.AuthorityURL) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &s.CredentialsType) + delete(rawMsg, key) + case "resourceUrl": + err = unpopulate(val, "ResourceURL", &s.ResourceURL) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &s.Secrets) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) delete(rawMsg, key) } if err != nil { @@ -12683,19 +22031,16 @@ func (s *ScaleSettingsInformation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServicePrincipalDatastoreSecrets. +func (s ServicePrincipalDatastoreSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) + populate(objectMap, "clientSecret", s.ClientSecret) + objectMap["secretsType"] = SecretsTypeServicePrincipal return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. -func (s *Schedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDatastoreSecrets. +func (s *ServicePrincipalDatastoreSecrets) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12703,20 +22048,11 @@ func (s *Schedule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &s.ClientSecret) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "secretsType": + err = unpopulate(val, "SecretsType", &s.SecretsType) delete(rawMsg, key) } if err != nil { @@ -12726,15 +22062,19 @@ func (s *Schedule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScheduleActionBase. -func (s ScheduleActionBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceTagDestination. +func (s ServiceTagDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["actionType"] = s.ActionType + populate(objectMap, "action", s.Action) + populate(objectMap, "addressPrefixes", s.AddressPrefixes) + populate(objectMap, "portRanges", s.PortRanges) + populate(objectMap, "protocol", s.Protocol) + populate(objectMap, "serviceTag", s.ServiceTag) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleActionBase. -func (s *ScheduleActionBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagDestination. +func (s *ServiceTagDestination) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12742,8 +22082,20 @@ func (s *ScheduleActionBase) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionType": - err = unpopulate(val, "ActionType", &s.ActionType) + case "action": + err = unpopulate(val, "Action", &s.Action) + delete(rawMsg, key) + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) + delete(rawMsg, key) + case "portRanges": + err = unpopulate(val, "PortRanges", &s.PortRanges) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &s.Protocol) + delete(rawMsg, key) + case "serviceTag": + err = unpopulate(val, "ServiceTag", &s.ServiceTag) delete(rawMsg, key) } if err != nil { @@ -12753,17 +22105,18 @@ func (s *ScheduleActionBase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScheduleBase. -func (s ScheduleBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceTagOutboundRule. +func (s ServiceTagOutboundRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "provisioningStatus", s.ProvisioningStatus) + populate(objectMap, "category", s.Category) + populate(objectMap, "destination", s.Destination) populate(objectMap, "status", s.Status) + objectMap["type"] = RuleTypeServiceTag return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleBase. -func (s *ScheduleBase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceTagOutboundRule. +func (s *ServiceTagOutboundRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12771,15 +22124,18 @@ func (s *ScheduleBase) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) + case "category": + err = unpopulate(val, "Category", &s.Category) delete(rawMsg, key) - case "provisioningStatus": - err = unpopulate(val, "ProvisioningStatus", &s.ProvisioningStatus) + case "destination": + err = unpopulate(val, "Destination", &s.Destination) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12788,22 +22144,15 @@ func (s *ScheduleBase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScheduleProperties. -func (s ScheduleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SetupScripts. +func (s SetupScripts) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", s.Action) - populate(objectMap, "description", s.Description) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "isEnabled", s.IsEnabled) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "trigger", s.Trigger) + populate(objectMap, "scripts", s.Scripts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties. -func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SetupScripts. +func (s *SetupScripts) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12811,29 +22160,8 @@ func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "action": - s.Action, err = unmarshalScheduleActionBaseClassification(val) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &s.IsEnabled) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "trigger": - s.Trigger, err = unmarshalTriggerBaseClassification(val) + case "scripts": + err = unpopulate(val, "Scripts", &s.Scripts) delete(rawMsg, key) } if err != nil { @@ -12843,16 +22171,16 @@ func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScheduleResourceArmPaginatedResult. -func (s ScheduleResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResource. +func (s SharedPrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleResourceArmPaginatedResult. -func (s *ScheduleResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResource. +func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12860,11 +22188,11 @@ func (s *ScheduleResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { @@ -12874,18 +22202,18 @@ func (s *ScheduleResourceArmPaginatedResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptReference. -func (s ScriptReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceProperty. +func (s SharedPrivateLinkResourceProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "scriptArguments", s.ScriptArguments) - populate(objectMap, "scriptData", s.ScriptData) - populate(objectMap, "scriptSource", s.ScriptSource) - populate(objectMap, "timeout", s.Timeout) + populate(objectMap, "groupId", s.GroupID) + populate(objectMap, "privateLinkResourceId", s.PrivateLinkResourceID) + populate(objectMap, "requestMessage", s.RequestMessage) + populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptReference. -func (s *ScriptReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceProperty. +func (s *SharedPrivateLinkResourceProperty) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12893,17 +22221,17 @@ func (s *ScriptReference) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "scriptArguments": - err = unpopulate(val, "ScriptArguments", &s.ScriptArguments) + case "groupId": + err = unpopulate(val, "GroupID", &s.GroupID) delete(rawMsg, key) - case "scriptData": - err = unpopulate(val, "ScriptData", &s.ScriptData) + case "privateLinkResourceId": + err = unpopulate(val, "PrivateLinkResourceID", &s.PrivateLinkResourceID) delete(rawMsg, key) - case "scriptSource": - err = unpopulate(val, "ScriptSource", &s.ScriptSource) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &s.RequestMessage) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &s.Timeout) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { @@ -12913,16 +22241,42 @@ func (s *ScriptReference) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptsToExecute. -func (s ScriptsToExecute) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SparkJob. +func (s SparkJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "creationScript", s.CreationScript) - populate(objectMap, "startupScript", s.StartupScript) + populate(objectMap, "archives", s.Archives) + populate(objectMap, "args", s.Args) + populate(objectMap, "codeId", s.CodeID) + populate(objectMap, "componentId", s.ComponentID) + populate(objectMap, "computeId", s.ComputeID) + populate(objectMap, "conf", s.Conf) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "entry", s.Entry) + populate(objectMap, "environmentId", s.EnvironmentID) + populate(objectMap, "environmentVariables", s.EnvironmentVariables) + populate(objectMap, "experimentName", s.ExperimentName) + populate(objectMap, "files", s.Files) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "inputs", s.Inputs) + populate(objectMap, "isArchived", s.IsArchived) + populate(objectMap, "jars", s.Jars) + objectMap["jobType"] = JobTypeSpark + populate(objectMap, "notificationSetting", s.NotificationSetting) + populate(objectMap, "outputs", s.Outputs) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "pyFiles", s.PyFiles) + populate(objectMap, "queueSettings", s.QueueSettings) + populate(objectMap, "resources", s.Resources) + populate(objectMap, "secretsConfiguration", s.SecretsConfiguration) + populate(objectMap, "services", s.Services) + populate(objectMap, "status", s.Status) + populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptsToExecute. -func (s *ScriptsToExecute) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SparkJob. +func (s *SparkJob) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12930,11 +22284,89 @@ func (s *ScriptsToExecute) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "creationScript": - err = unpopulate(val, "CreationScript", &s.CreationScript) + case "archives": + err = unpopulate(val, "Archives", &s.Archives) delete(rawMsg, key) - case "startupScript": - err = unpopulate(val, "StartupScript", &s.StartupScript) + case "args": + err = unpopulate(val, "Args", &s.Args) + delete(rawMsg, key) + case "codeId": + err = unpopulate(val, "CodeID", &s.CodeID) + delete(rawMsg, key) + case "componentId": + err = unpopulate(val, "ComponentID", &s.ComponentID) + delete(rawMsg, key) + case "computeId": + err = unpopulate(val, "ComputeID", &s.ComputeID) + delete(rawMsg, key) + case "conf": + err = unpopulate(val, "Conf", &s.Conf) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "entry": + s.Entry, err = unmarshalSparkJobEntryClassification(val) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &s.EnvironmentID) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &s.EnvironmentVariables) + delete(rawMsg, key) + case "experimentName": + err = unpopulate(val, "ExperimentName", &s.ExperimentName) + delete(rawMsg, key) + case "files": + err = unpopulate(val, "Files", &s.Files) + delete(rawMsg, key) + case "identity": + s.Identity, err = unmarshalIdentityConfigurationClassification(val) + delete(rawMsg, key) + case "inputs": + s.Inputs, err = unmarshalJobInputClassificationMap(val) + delete(rawMsg, key) + case "isArchived": + err = unpopulate(val, "IsArchived", &s.IsArchived) + delete(rawMsg, key) + case "jars": + err = unpopulate(val, "Jars", &s.Jars) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &s.JobType) + delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &s.NotificationSetting) + delete(rawMsg, key) + case "outputs": + s.Outputs, err = unmarshalJobOutputClassificationMap(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "pyFiles": + err = unpopulate(val, "PyFiles", &s.PyFiles) + delete(rawMsg, key) + case "queueSettings": + err = unpopulate(val, "QueueSettings", &s.QueueSettings) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &s.Resources) + delete(rawMsg, key) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &s.SecretsConfiguration) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &s.Services) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) } if err != nil { @@ -12944,15 +22376,15 @@ func (s *ScriptsToExecute) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Seasonality. -func (s Seasonality) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SparkJobEntry. +func (s SparkJobEntry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = s.Mode + objectMap["sparkJobEntryType"] = s.SparkJobEntryType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Seasonality. -func (s *Seasonality) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SparkJobEntry. +func (s *SparkJobEntry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12960,8 +22392,8 @@ func (s *Seasonality) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &s.Mode) + case "sparkJobEntryType": + err = unpopulate(val, "SparkJobEntryType", &s.SparkJobEntryType) delete(rawMsg, key) } if err != nil { @@ -12971,15 +22403,16 @@ func (s *Seasonality) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceManagedResourcesSettings. -func (s ServiceManagedResourcesSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SparkJobPythonEntry. +func (s SparkJobPythonEntry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cosmosDb", s.CosmosDb) + populate(objectMap, "file", s.File) + objectMap["sparkJobEntryType"] = SparkJobEntryTypeSparkJobPythonEntry return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceManagedResourcesSettings. -func (s *ServiceManagedResourcesSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SparkJobPythonEntry. +func (s *SparkJobPythonEntry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12987,8 +22420,11 @@ func (s *ServiceManagedResourcesSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "cosmosDb": - err = unpopulate(val, "CosmosDb", &s.CosmosDb) + case "file": + err = unpopulate(val, "File", &s.File) + delete(rawMsg, key) + case "sparkJobEntryType": + err = unpopulate(val, "SparkJobEntryType", &s.SparkJobEntryType) delete(rawMsg, key) } if err != nil { @@ -12998,20 +22434,16 @@ func (s *ServiceManagedResourcesSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ServicePrincipalDatastoreCredentials. -func (s ServicePrincipalDatastoreCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SparkJobScalaEntry. +func (s SparkJobScalaEntry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorityUrl", s.AuthorityURL) - populate(objectMap, "clientId", s.ClientID) - objectMap["credentialsType"] = CredentialsTypeServicePrincipal - populate(objectMap, "resourceUrl", s.ResourceURL) - populate(objectMap, "secrets", s.Secrets) - populate(objectMap, "tenantId", s.TenantID) + populate(objectMap, "className", s.ClassName) + objectMap["sparkJobEntryType"] = SparkJobEntryTypeSparkJobScalaEntry return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDatastoreCredentials. -func (s *ServicePrincipalDatastoreCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SparkJobScalaEntry. +func (s *SparkJobScalaEntry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -13019,23 +22451,11 @@ func (s *ServicePrincipalDatastoreCredentials) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "authorityUrl": - err = unpopulate(val, "AuthorityURL", &s.AuthorityURL) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &s.ClientID) - delete(rawMsg, key) - case "credentialsType": - err = unpopulate(val, "CredentialsType", &s.CredentialsType) - delete(rawMsg, key) - case "resourceUrl": - err = unpopulate(val, "ResourceURL", &s.ResourceURL) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) + case "className": + err = unpopulate(val, "ClassName", &s.ClassName) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &s.TenantID) + case "sparkJobEntryType": + err = unpopulate(val, "SparkJobEntryType", &s.SparkJobEntryType) delete(rawMsg, key) } if err != nil { @@ -13045,16 +22465,16 @@ func (s *ServicePrincipalDatastoreCredentials) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ServicePrincipalDatastoreSecrets. -func (s ServicePrincipalDatastoreSecrets) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SparkResourceConfiguration. +func (s SparkResourceConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientSecret", s.ClientSecret) - objectMap["secretsType"] = SecretsTypeServicePrincipal + populate(objectMap, "instanceType", s.InstanceType) + populate(objectMap, "runtimeVersion", s.RuntimeVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalDatastoreSecrets. -func (s *ServicePrincipalDatastoreSecrets) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SparkResourceConfiguration. +func (s *SparkResourceConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -13062,11 +22482,11 @@ func (s *ServicePrincipalDatastoreSecrets) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientSecret": - err = unpopulate(val, "ClientSecret", &s.ClientSecret) + case "instanceType": + err = unpopulate(val, "InstanceType", &s.InstanceType) delete(rawMsg, key) - case "secretsType": - err = unpopulate(val, "SecretsType", &s.SecretsType) + case "runtimeVersion": + err = unpopulate(val, "RuntimeVersion", &s.RuntimeVersion) delete(rawMsg, key) } if err != nil { @@ -13076,15 +22496,17 @@ func (s *ServicePrincipalDatastoreSecrets) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SetupScripts. -func (s SetupScripts) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StackEnsembleSettings. +func (s StackEnsembleSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "scripts", s.Scripts) + populateAny(objectMap, "stackMetaLearnerKWargs", s.StackMetaLearnerKWargs) + populate(objectMap, "stackMetaLearnerTrainPercentage", s.StackMetaLearnerTrainPercentage) + populate(objectMap, "stackMetaLearnerType", s.StackMetaLearnerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SetupScripts. -func (s *SetupScripts) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StackEnsembleSettings. +func (s *StackEnsembleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -13092,8 +22514,14 @@ func (s *SetupScripts) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "scripts": - err = unpopulate(val, "Scripts", &s.Scripts) + case "stackMetaLearnerKWargs": + err = unpopulate(val, "StackMetaLearnerKWargs", &s.StackMetaLearnerKWargs) + delete(rawMsg, key) + case "stackMetaLearnerTrainPercentage": + err = unpopulate(val, "StackMetaLearnerTrainPercentage", &s.StackMetaLearnerTrainPercentage) + delete(rawMsg, key) + case "stackMetaLearnerType": + err = unpopulate(val, "StackMetaLearnerType", &s.StackMetaLearnerType) delete(rawMsg, key) } if err != nil { @@ -13103,16 +22531,22 @@ func (s *SetupScripts) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResource. -func (s SharedPrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StaticInputData. +func (s StaticInputData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "dataContext", s.DataContext) + objectMap["inputDataType"] = MonitoringInputDataTypeStatic + populate(objectMap, "jobInputType", s.JobInputType) + populate(objectMap, "preprocessingComponentId", s.PreprocessingComponentID) + populate(objectMap, "uri", s.URI) + populateDateTimeRFC3339(objectMap, "windowEnd", s.WindowEnd) + populateDateTimeRFC3339(objectMap, "windowStart", s.WindowStart) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResource. -func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticInputData. +func (s *StaticInputData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -13120,11 +22554,29 @@ func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) + case "columns": + err = unpopulate(val, "Columns", &s.Columns) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "dataContext": + err = unpopulate(val, "DataContext", &s.DataContext) + delete(rawMsg, key) + case "inputDataType": + err = unpopulate(val, "InputDataType", &s.InputDataType) + delete(rawMsg, key) + case "jobInputType": + err = unpopulate(val, "JobInputType", &s.JobInputType) + delete(rawMsg, key) + case "preprocessingComponentId": + err = unpopulate(val, "PreprocessingComponentID", &s.PreprocessingComponentID) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &s.URI) + delete(rawMsg, key) + case "windowEnd": + err = unpopulateDateTimeRFC3339(val, "WindowEnd", &s.WindowEnd) + delete(rawMsg, key) + case "windowStart": + err = unpopulateDateTimeRFC3339(val, "WindowStart", &s.WindowStart) delete(rawMsg, key) } if err != nil { @@ -13134,18 +22586,18 @@ func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceProperty. -func (s SharedPrivateLinkResourceProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StatusMessage. +func (s StatusMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", s.GroupID) - populate(objectMap, "privateLinkResourceId", s.PrivateLinkResourceID) - populate(objectMap, "requestMessage", s.RequestMessage) - populate(objectMap, "status", s.Status) + populate(objectMap, "code", s.Code) + populateDateTimeRFC3339(objectMap, "createdDateTime", s.CreatedDateTime) + populate(objectMap, "level", s.Level) + populate(objectMap, "message", s.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceProperty. -func (s *SharedPrivateLinkResourceProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StatusMessage. +func (s *StatusMessage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -13153,17 +22605,17 @@ func (s *SharedPrivateLinkResourceProperty) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &s.GroupID) + case "code": + err = unpopulate(val, "Code", &s.Code) delete(rawMsg, key) - case "privateLinkResourceId": - err = unpopulate(val, "PrivateLinkResourceID", &s.PrivateLinkResourceID) + case "createdDateTime": + err = unpopulateDateTimeRFC3339(val, "CreatedDateTime", &s.CreatedDateTime) delete(rawMsg, key) - case "requestMessage": - err = unpopulate(val, "RequestMessage", &s.RequestMessage) + case "level": + err = unpopulate(val, "Level", &s.Level) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + case "message": + err = unpopulate(val, "Message", &s.Message) delete(rawMsg, key) } if err != nil { @@ -13173,17 +22625,16 @@ func (s *SharedPrivateLinkResourceProperty) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type StackEnsembleSettings. -func (s StackEnsembleSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StorageAccountDetails. +func (s StorageAccountDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "stackMetaLearnerKWargs", s.StackMetaLearnerKWargs) - populate(objectMap, "stackMetaLearnerTrainPercentage", s.StackMetaLearnerTrainPercentage) - populate(objectMap, "stackMetaLearnerType", s.StackMetaLearnerType) + populate(objectMap, "systemCreatedStorageAccount", s.SystemCreatedStorageAccount) + populate(objectMap, "userCreatedStorageAccount", s.UserCreatedStorageAccount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StackEnsembleSettings. -func (s *StackEnsembleSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccountDetails. +func (s *StorageAccountDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -13191,14 +22642,11 @@ func (s *StackEnsembleSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "stackMetaLearnerKWargs": - err = unpopulate(val, "StackMetaLearnerKWargs", &s.StackMetaLearnerKWargs) - delete(rawMsg, key) - case "stackMetaLearnerTrainPercentage": - err = unpopulate(val, "StackMetaLearnerTrainPercentage", &s.StackMetaLearnerTrainPercentage) + case "systemCreatedStorageAccount": + err = unpopulate(val, "SystemCreatedStorageAccount", &s.SystemCreatedStorageAccount) delete(rawMsg, key) - case "stackMetaLearnerType": - err = unpopulate(val, "StackMetaLearnerType", &s.StackMetaLearnerType) + case "userCreatedStorageAccount": + err = unpopulate(val, "UserCreatedStorageAccount", &s.UserCreatedStorageAccount) delete(rawMsg, key) } if err != nil { @@ -13211,6 +22659,7 @@ func (s *StackEnsembleSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SweepJob. func (s SweepJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "componentConfiguration", s.ComponentConfiguration) populate(objectMap, "componentId", s.ComponentID) populate(objectMap, "computeId", s.ComputeID) populate(objectMap, "description", s.Description) @@ -13222,11 +22671,15 @@ func (s SweepJob) MarshalJSON() ([]byte, error) { populate(objectMap, "isArchived", s.IsArchived) objectMap["jobType"] = JobTypeSweep populate(objectMap, "limits", s.Limits) + populate(objectMap, "notificationSetting", s.NotificationSetting) populate(objectMap, "objective", s.Objective) populate(objectMap, "outputs", s.Outputs) populate(objectMap, "properties", s.Properties) + populate(objectMap, "queueSettings", s.QueueSettings) + populate(objectMap, "resources", s.Resources) populate(objectMap, "samplingAlgorithm", s.SamplingAlgorithm) populateAny(objectMap, "searchSpace", s.SearchSpace) + populate(objectMap, "secretsConfiguration", s.SecretsConfiguration) populate(objectMap, "services", s.Services) populate(objectMap, "status", s.Status) populate(objectMap, "tags", s.Tags) @@ -13243,6 +22696,9 @@ func (s *SweepJob) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "componentConfiguration": + err = unpopulate(val, "ComponentConfiguration", &s.ComponentConfiguration) + delete(rawMsg, key) case "componentId": err = unpopulate(val, "ComponentID", &s.ComponentID) delete(rawMsg, key) @@ -13276,6 +22732,9 @@ func (s *SweepJob) UnmarshalJSON(data []byte) error { case "limits": err = unpopulate(val, "Limits", &s.Limits) delete(rawMsg, key) + case "notificationSetting": + err = unpopulate(val, "NotificationSetting", &s.NotificationSetting) + delete(rawMsg, key) case "objective": err = unpopulate(val, "Objective", &s.Objective) delete(rawMsg, key) @@ -13285,12 +22744,21 @@ func (s *SweepJob) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "queueSettings": + err = unpopulate(val, "QueueSettings", &s.QueueSettings) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &s.Resources) + delete(rawMsg, key) case "samplingAlgorithm": s.SamplingAlgorithm, err = unmarshalSamplingAlgorithmClassification(val) delete(rawMsg, key) case "searchSpace": err = unpopulate(val, "SearchSpace", &s.SearchSpace) delete(rawMsg, key) + case "secretsConfiguration": + err = unpopulate(val, "SecretsConfiguration", &s.SecretsConfiguration) + delete(rawMsg, key) case "services": err = unpopulate(val, "Services", &s.Services) delete(rawMsg, key) @@ -13359,11 +22827,11 @@ func (s SynapseSpark) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "computeLocation", s.ComputeLocation) objectMap["computeType"] = ComputeTypeSynapseSpark - populateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populateDateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) populate(objectMap, "description", s.Description) populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) populate(objectMap, "isAttachedCompute", s.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", s.ModifiedOn) + populateDateTimeRFC3339(objectMap, "modifiedOn", s.ModifiedOn) populate(objectMap, "properties", s.Properties) populate(objectMap, "provisioningErrors", s.ProvisioningErrors) populate(objectMap, "provisioningState", s.ProvisioningState) @@ -13387,7 +22855,7 @@ func (s *SynapseSpark) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ComputeType", &s.ComputeType) delete(rawMsg, key) case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &s.CreatedOn) + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &s.CreatedOn) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &s.Description) @@ -13399,7 +22867,7 @@ func (s *SynapseSpark) UnmarshalJSON(data []byte) error { err = unpopulate(val, "IsAttachedCompute", &s.IsAttachedCompute) delete(rawMsg, key) case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &s.ModifiedOn) + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &s.ModifiedOn) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) @@ -13467,14 +22935,92 @@ func (s *SynapseSparkProperties) UnmarshalJSON(data []byte) error { case "resourceGroup": err = unpopulate(val, "ResourceGroup", &s.ResourceGroup) delete(rawMsg, key) - case "sparkVersion": - err = unpopulate(val, "SparkVersion", &s.SparkVersion) + case "sparkVersion": + err = unpopulate(val, "SparkVersion", &s.SparkVersion) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &s.SubscriptionID) + delete(rawMsg, key) + case "workspaceName": + err = unpopulate(val, "WorkspaceName", &s.WorkspaceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemCreatedAcrAccount. +func (s SystemCreatedAcrAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "acrAccountName", s.AcrAccountName) + populate(objectMap, "acrAccountSku", s.AcrAccountSKU) + populate(objectMap, "armResourceId", s.ArmResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemCreatedAcrAccount. +func (s *SystemCreatedAcrAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "acrAccountName": + err = unpopulate(val, "AcrAccountName", &s.AcrAccountName) + delete(rawMsg, key) + case "acrAccountSku": + err = unpopulate(val, "AcrAccountSKU", &s.AcrAccountSKU) + delete(rawMsg, key) + case "armResourceId": + err = unpopulate(val, "ArmResourceID", &s.ArmResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemCreatedStorageAccount. +func (s SystemCreatedStorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowBlobPublicAccess", s.AllowBlobPublicAccess) + populate(objectMap, "armResourceId", s.ArmResourceID) + populate(objectMap, "storageAccountHnsEnabled", s.StorageAccountHnsEnabled) + populate(objectMap, "storageAccountName", s.StorageAccountName) + populate(objectMap, "storageAccountType", s.StorageAccountType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemCreatedStorageAccount. +func (s *SystemCreatedStorageAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowBlobPublicAccess": + err = unpopulate(val, "AllowBlobPublicAccess", &s.AllowBlobPublicAccess) + delete(rawMsg, key) + case "armResourceId": + err = unpopulate(val, "ArmResourceID", &s.ArmResourceID) delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &s.SubscriptionID) + case "storageAccountHnsEnabled": + err = unpopulate(val, "StorageAccountHnsEnabled", &s.StorageAccountHnsEnabled) delete(rawMsg, key) - case "workspaceName": - err = unpopulate(val, "WorkspaceName", &s.WorkspaceName) + case "storageAccountName": + err = unpopulate(val, "StorageAccountName", &s.StorageAccountName) + delete(rawMsg, key) + case "storageAccountType": + err = unpopulate(val, "StorageAccountType", &s.StorageAccountType) delete(rawMsg, key) } if err != nil { @@ -13487,10 +23033,10 @@ func (s *SynapseSparkProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -13506,7 +23052,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { var err error switch key { case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) @@ -13515,7 +23061,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) @@ -13566,13 +23112,253 @@ func (s *SystemService) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TableFixedParameters. +func (t TableFixedParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "booster", t.Booster) + populate(objectMap, "boostingType", t.BoostingType) + populate(objectMap, "growPolicy", t.GrowPolicy) + populate(objectMap, "learningRate", t.LearningRate) + populate(objectMap, "maxBin", t.MaxBin) + populate(objectMap, "maxDepth", t.MaxDepth) + populate(objectMap, "maxLeaves", t.MaxLeaves) + populate(objectMap, "minDataInLeaf", t.MinDataInLeaf) + populate(objectMap, "minSplitGain", t.MinSplitGain) + populate(objectMap, "modelName", t.ModelName) + populate(objectMap, "nEstimators", t.NEstimators) + populate(objectMap, "numLeaves", t.NumLeaves) + populate(objectMap, "preprocessorName", t.PreprocessorName) + populate(objectMap, "regAlpha", t.RegAlpha) + populate(objectMap, "regLambda", t.RegLambda) + populate(objectMap, "subsample", t.Subsample) + populate(objectMap, "subsampleFreq", t.SubsampleFreq) + populate(objectMap, "treeMethod", t.TreeMethod) + populate(objectMap, "withMean", t.WithMean) + populate(objectMap, "withStd", t.WithStd) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableFixedParameters. +func (t *TableFixedParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "booster": + err = unpopulate(val, "Booster", &t.Booster) + delete(rawMsg, key) + case "boostingType": + err = unpopulate(val, "BoostingType", &t.BoostingType) + delete(rawMsg, key) + case "growPolicy": + err = unpopulate(val, "GrowPolicy", &t.GrowPolicy) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &t.LearningRate) + delete(rawMsg, key) + case "maxBin": + err = unpopulate(val, "MaxBin", &t.MaxBin) + delete(rawMsg, key) + case "maxDepth": + err = unpopulate(val, "MaxDepth", &t.MaxDepth) + delete(rawMsg, key) + case "maxLeaves": + err = unpopulate(val, "MaxLeaves", &t.MaxLeaves) + delete(rawMsg, key) + case "minDataInLeaf": + err = unpopulate(val, "MinDataInLeaf", &t.MinDataInLeaf) + delete(rawMsg, key) + case "minSplitGain": + err = unpopulate(val, "MinSplitGain", &t.MinSplitGain) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &t.ModelName) + delete(rawMsg, key) + case "nEstimators": + err = unpopulate(val, "NEstimators", &t.NEstimators) + delete(rawMsg, key) + case "numLeaves": + err = unpopulate(val, "NumLeaves", &t.NumLeaves) + delete(rawMsg, key) + case "preprocessorName": + err = unpopulate(val, "PreprocessorName", &t.PreprocessorName) + delete(rawMsg, key) + case "regAlpha": + err = unpopulate(val, "RegAlpha", &t.RegAlpha) + delete(rawMsg, key) + case "regLambda": + err = unpopulate(val, "RegLambda", &t.RegLambda) + delete(rawMsg, key) + case "subsample": + err = unpopulate(val, "Subsample", &t.Subsample) + delete(rawMsg, key) + case "subsampleFreq": + err = unpopulate(val, "SubsampleFreq", &t.SubsampleFreq) + delete(rawMsg, key) + case "treeMethod": + err = unpopulate(val, "TreeMethod", &t.TreeMethod) + delete(rawMsg, key) + case "withMean": + err = unpopulate(val, "WithMean", &t.WithMean) + delete(rawMsg, key) + case "withStd": + err = unpopulate(val, "WithStd", &t.WithStd) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableParameterSubspace. +func (t TableParameterSubspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "booster", t.Booster) + populate(objectMap, "boostingType", t.BoostingType) + populate(objectMap, "growPolicy", t.GrowPolicy) + populate(objectMap, "learningRate", t.LearningRate) + populate(objectMap, "maxBin", t.MaxBin) + populate(objectMap, "maxDepth", t.MaxDepth) + populate(objectMap, "maxLeaves", t.MaxLeaves) + populate(objectMap, "minDataInLeaf", t.MinDataInLeaf) + populate(objectMap, "minSplitGain", t.MinSplitGain) + populate(objectMap, "modelName", t.ModelName) + populate(objectMap, "nEstimators", t.NEstimators) + populate(objectMap, "numLeaves", t.NumLeaves) + populate(objectMap, "preprocessorName", t.PreprocessorName) + populate(objectMap, "regAlpha", t.RegAlpha) + populate(objectMap, "regLambda", t.RegLambda) + populate(objectMap, "subsample", t.Subsample) + populate(objectMap, "subsampleFreq", t.SubsampleFreq) + populate(objectMap, "treeMethod", t.TreeMethod) + populate(objectMap, "withMean", t.WithMean) + populate(objectMap, "withStd", t.WithStd) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableParameterSubspace. +func (t *TableParameterSubspace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "booster": + err = unpopulate(val, "Booster", &t.Booster) + delete(rawMsg, key) + case "boostingType": + err = unpopulate(val, "BoostingType", &t.BoostingType) + delete(rawMsg, key) + case "growPolicy": + err = unpopulate(val, "GrowPolicy", &t.GrowPolicy) + delete(rawMsg, key) + case "learningRate": + err = unpopulate(val, "LearningRate", &t.LearningRate) + delete(rawMsg, key) + case "maxBin": + err = unpopulate(val, "MaxBin", &t.MaxBin) + delete(rawMsg, key) + case "maxDepth": + err = unpopulate(val, "MaxDepth", &t.MaxDepth) + delete(rawMsg, key) + case "maxLeaves": + err = unpopulate(val, "MaxLeaves", &t.MaxLeaves) + delete(rawMsg, key) + case "minDataInLeaf": + err = unpopulate(val, "MinDataInLeaf", &t.MinDataInLeaf) + delete(rawMsg, key) + case "minSplitGain": + err = unpopulate(val, "MinSplitGain", &t.MinSplitGain) + delete(rawMsg, key) + case "modelName": + err = unpopulate(val, "ModelName", &t.ModelName) + delete(rawMsg, key) + case "nEstimators": + err = unpopulate(val, "NEstimators", &t.NEstimators) + delete(rawMsg, key) + case "numLeaves": + err = unpopulate(val, "NumLeaves", &t.NumLeaves) + delete(rawMsg, key) + case "preprocessorName": + err = unpopulate(val, "PreprocessorName", &t.PreprocessorName) + delete(rawMsg, key) + case "regAlpha": + err = unpopulate(val, "RegAlpha", &t.RegAlpha) + delete(rawMsg, key) + case "regLambda": + err = unpopulate(val, "RegLambda", &t.RegLambda) + delete(rawMsg, key) + case "subsample": + err = unpopulate(val, "Subsample", &t.Subsample) + delete(rawMsg, key) + case "subsampleFreq": + err = unpopulate(val, "SubsampleFreq", &t.SubsampleFreq) + delete(rawMsg, key) + case "treeMethod": + err = unpopulate(val, "TreeMethod", &t.TreeMethod) + delete(rawMsg, key) + case "withMean": + err = unpopulate(val, "WithMean", &t.WithMean) + delete(rawMsg, key) + case "withStd": + err = unpopulate(val, "WithStd", &t.WithStd) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableSweepSettings. +func (t TableSweepSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "earlyTermination", t.EarlyTermination) + populate(objectMap, "samplingAlgorithm", t.SamplingAlgorithm) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableSweepSettings. +func (t *TableSweepSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "earlyTermination": + t.EarlyTermination, err = unmarshalEarlyTerminationPolicyClassification(val) + delete(rawMsg, key) + case "samplingAlgorithm": + err = unpopulate(val, "SamplingAlgorithm", &t.SamplingAlgorithm) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TableVertical. func (t TableVertical) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cvSplitColumnNames", t.CvSplitColumnNames) populate(objectMap, "featurizationSettings", t.FeaturizationSettings) + populate(objectMap, "fixedParameters", t.FixedParameters) populate(objectMap, "limitSettings", t.LimitSettings) populate(objectMap, "nCrossValidations", t.NCrossValidations) + populate(objectMap, "searchSpace", t.SearchSpace) + populate(objectMap, "sweepSettings", t.SweepSettings) populate(objectMap, "testData", t.TestData) populate(objectMap, "testDataSize", t.TestDataSize) populate(objectMap, "validationData", t.ValidationData) @@ -13596,12 +23382,21 @@ func (t *TableVertical) UnmarshalJSON(data []byte) error { case "featurizationSettings": err = unpopulate(val, "FeaturizationSettings", &t.FeaturizationSettings) delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &t.FixedParameters) + delete(rawMsg, key) case "limitSettings": err = unpopulate(val, "LimitSettings", &t.LimitSettings) delete(rawMsg, key) case "nCrossValidations": t.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &t.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &t.SweepSettings) + delete(rawMsg, key) case "testData": err = unpopulate(val, "TestData", &t.TestData) delete(rawMsg, key) @@ -13679,7 +23474,10 @@ func (t TableVerticalLimitSettings) MarshalJSON() ([]byte, error) { populate(objectMap, "exitScore", t.ExitScore) populate(objectMap, "maxConcurrentTrials", t.MaxConcurrentTrials) populate(objectMap, "maxCoresPerTrial", t.MaxCoresPerTrial) + populate(objectMap, "maxNodes", t.MaxNodes) populate(objectMap, "maxTrials", t.MaxTrials) + populate(objectMap, "sweepConcurrentTrials", t.SweepConcurrentTrials) + populate(objectMap, "sweepTrials", t.SweepTrials) populate(objectMap, "timeout", t.Timeout) populate(objectMap, "trialTimeout", t.TrialTimeout) return json.Marshal(objectMap) @@ -13706,9 +23504,18 @@ func (t *TableVerticalLimitSettings) UnmarshalJSON(data []byte) error { case "maxCoresPerTrial": err = unpopulate(val, "MaxCoresPerTrial", &t.MaxCoresPerTrial) delete(rawMsg, key) + case "maxNodes": + err = unpopulate(val, "MaxNodes", &t.MaxNodes) + delete(rawMsg, key) case "maxTrials": err = unpopulate(val, "MaxTrials", &t.MaxTrials) delete(rawMsg, key) + case "sweepConcurrentTrials": + err = unpopulate(val, "SweepConcurrentTrials", &t.SweepConcurrentTrials) + delete(rawMsg, key) + case "sweepTrials": + err = unpopulate(val, "SweepTrials", &t.SweepTrials) + delete(rawMsg, key) case "timeout": err = unpopulate(val, "Timeout", &t.Timeout) delete(rawMsg, key) @@ -13859,9 +23666,12 @@ func (t *TensorFlow) UnmarshalJSON(data []byte) error { func (t TextClassification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "featurizationSettings", t.FeaturizationSettings) + populate(objectMap, "fixedParameters", t.FixedParameters) populate(objectMap, "limitSettings", t.LimitSettings) populate(objectMap, "logVerbosity", t.LogVerbosity) populate(objectMap, "primaryMetric", t.PrimaryMetric) + populate(objectMap, "searchSpace", t.SearchSpace) + populate(objectMap, "sweepSettings", t.SweepSettings) populate(objectMap, "targetColumnName", t.TargetColumnName) objectMap["taskType"] = TaskTypeTextClassification populate(objectMap, "trainingData", t.TrainingData) @@ -13881,6 +23691,9 @@ func (t *TextClassification) UnmarshalJSON(data []byte) error { case "featurizationSettings": err = unpopulate(val, "FeaturizationSettings", &t.FeaturizationSettings) delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &t.FixedParameters) + delete(rawMsg, key) case "limitSettings": err = unpopulate(val, "LimitSettings", &t.LimitSettings) delete(rawMsg, key) @@ -13890,6 +23703,12 @@ func (t *TextClassification) UnmarshalJSON(data []byte) error { case "primaryMetric": err = unpopulate(val, "PrimaryMetric", &t.PrimaryMetric) delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &t.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &t.SweepSettings) + delete(rawMsg, key) case "targetColumnName": err = unpopulate(val, "TargetColumnName", &t.TargetColumnName) delete(rawMsg, key) @@ -13914,9 +23733,12 @@ func (t *TextClassification) UnmarshalJSON(data []byte) error { func (t TextClassificationMultilabel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "featurizationSettings", t.FeaturizationSettings) + populate(objectMap, "fixedParameters", t.FixedParameters) populate(objectMap, "limitSettings", t.LimitSettings) populate(objectMap, "logVerbosity", t.LogVerbosity) populate(objectMap, "primaryMetric", t.PrimaryMetric) + populate(objectMap, "searchSpace", t.SearchSpace) + populate(objectMap, "sweepSettings", t.SweepSettings) populate(objectMap, "targetColumnName", t.TargetColumnName) objectMap["taskType"] = TaskTypeTextClassificationMultilabel populate(objectMap, "trainingData", t.TrainingData) @@ -13936,6 +23758,9 @@ func (t *TextClassificationMultilabel) UnmarshalJSON(data []byte) error { case "featurizationSettings": err = unpopulate(val, "FeaturizationSettings", &t.FeaturizationSettings) delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &t.FixedParameters) + delete(rawMsg, key) case "limitSettings": err = unpopulate(val, "LimitSettings", &t.LimitSettings) delete(rawMsg, key) @@ -13945,6 +23770,12 @@ func (t *TextClassificationMultilabel) UnmarshalJSON(data []byte) error { case "primaryMetric": err = unpopulate(val, "PrimaryMetric", &t.PrimaryMetric) delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &t.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &t.SweepSettings) + delete(rawMsg, key) case "targetColumnName": err = unpopulate(val, "TargetColumnName", &t.TargetColumnName) delete(rawMsg, key) @@ -13969,9 +23800,12 @@ func (t *TextClassificationMultilabel) UnmarshalJSON(data []byte) error { func (t TextNer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "featurizationSettings", t.FeaturizationSettings) + populate(objectMap, "fixedParameters", t.FixedParameters) populate(objectMap, "limitSettings", t.LimitSettings) populate(objectMap, "logVerbosity", t.LogVerbosity) populate(objectMap, "primaryMetric", t.PrimaryMetric) + populate(objectMap, "searchSpace", t.SearchSpace) + populate(objectMap, "sweepSettings", t.SweepSettings) populate(objectMap, "targetColumnName", t.TargetColumnName) objectMap["taskType"] = TaskTypeTextNER populate(objectMap, "trainingData", t.TrainingData) @@ -13991,6 +23825,9 @@ func (t *TextNer) UnmarshalJSON(data []byte) error { case "featurizationSettings": err = unpopulate(val, "FeaturizationSettings", &t.FeaturizationSettings) delete(rawMsg, key) + case "fixedParameters": + err = unpopulate(val, "FixedParameters", &t.FixedParameters) + delete(rawMsg, key) case "limitSettings": err = unpopulate(val, "LimitSettings", &t.LimitSettings) delete(rawMsg, key) @@ -14000,6 +23837,12 @@ func (t *TextNer) UnmarshalJSON(data []byte) error { case "primaryMetric": err = unpopulate(val, "PrimaryMetric", &t.PrimaryMetric) delete(rawMsg, key) + case "searchSpace": + err = unpopulate(val, "SearchSpace", &t.SearchSpace) + delete(rawMsg, key) + case "sweepSettings": + err = unpopulate(val, "SweepSettings", &t.SweepSettings) + delete(rawMsg, key) case "targetColumnName": err = unpopulate(val, "TargetColumnName", &t.TargetColumnName) delete(rawMsg, key) @@ -14020,6 +23863,64 @@ func (t *TextNer) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TmpfsOptions. +func (t TmpfsOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "size", t.Size) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TmpfsOptions. +func (t *TmpfsOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "size": + err = unpopulate(val, "Size", &t.Size) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TopNFeaturesByAttribution. +func (t TopNFeaturesByAttribution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["filterType"] = MonitoringFeatureFilterTypeTopNByAttribution + populate(objectMap, "top", t.Top) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopNFeaturesByAttribution. +func (t *TopNFeaturesByAttribution) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "filterType": + err = unpopulate(val, "FilterType", &t.FilterType) + delete(rawMsg, key) + case "top": + err = unpopulate(val, "Top", &t.Top) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14077,6 +23978,7 @@ func (t TrainingSettings) MarshalJSON() ([]byte, error) { populate(objectMap, "enableVoteEnsemble", t.EnableVoteEnsemble) populate(objectMap, "ensembleModelDownloadTimeout", t.EnsembleModelDownloadTimeout) populate(objectMap, "stackEnsembleSettings", t.StackEnsembleSettings) + populate(objectMap, "trainingMode", t.TrainingMode) return json.Marshal(objectMap) } @@ -14110,6 +24012,9 @@ func (t *TrainingSettings) UnmarshalJSON(data []byte) error { case "stackEnsembleSettings": err = unpopulate(val, "StackEnsembleSettings", &t.StackEnsembleSettings) delete(rawMsg, key) + case "trainingMode": + err = unpopulate(val, "TrainingMode", &t.TrainingMode) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -14204,6 +24109,37 @@ func (t *TriggerBase) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TritonInferencingServer. +func (t TritonInferencingServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inferenceConfiguration", t.InferenceConfiguration) + objectMap["serverType"] = InferencingServerTypeTriton + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TritonInferencingServer. +func (t *TritonInferencingServer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inferenceConfiguration": + err = unpopulate(val, "InferenceConfiguration", &t.InferenceConfiguration) + delete(rawMsg, key) + case "serverType": + err = unpopulate(val, "ServerType", &t.ServerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TritonModelJobInput. func (t TritonModelJobInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14246,6 +24182,9 @@ func (t *TritonModelJobInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TritonModelJobOutput. func (t TritonModelJobOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "assetName", t.AssetName) + populate(objectMap, "assetVersion", t.AssetVersion) + populate(objectMap, "autoDeleteSetting", t.AutoDeleteSetting) populate(objectMap, "description", t.Description) objectMap["jobOutputType"] = JobOutputTypeTritonModel populate(objectMap, "mode", t.Mode) @@ -14262,6 +24201,15 @@ func (t *TritonModelJobOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "assetName": + err = unpopulate(val, "AssetName", &t.AssetName) + delete(rawMsg, key) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &t.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &t.AutoDeleteSetting) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &t.Description) delete(rawMsg, key) @@ -14324,12 +24272,15 @@ func (t *TruncationSelectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URIFileDataVersion. func (u URIFileDataVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", u.AutoDeleteSetting) objectMap["dataType"] = DataTypeURIFile populate(objectMap, "dataUri", u.DataURI) populate(objectMap, "description", u.Description) + populate(objectMap, "intellectualProperty", u.IntellectualProperty) populate(objectMap, "isAnonymous", u.IsAnonymous) populate(objectMap, "isArchived", u.IsArchived) populate(objectMap, "properties", u.Properties) + populate(objectMap, "stage", u.Stage) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) } @@ -14343,6 +24294,9 @@ func (u *URIFileDataVersion) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &u.AutoDeleteSetting) + delete(rawMsg, key) case "dataType": err = unpopulate(val, "DataType", &u.DataType) delete(rawMsg, key) @@ -14352,6 +24306,9 @@ func (u *URIFileDataVersion) UnmarshalJSON(data []byte) error { case "description": err = unpopulate(val, "Description", &u.Description) delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &u.IntellectualProperty) + delete(rawMsg, key) case "isAnonymous": err = unpopulate(val, "IsAnonymous", &u.IsAnonymous) delete(rawMsg, key) @@ -14361,6 +24318,9 @@ func (u *URIFileDataVersion) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &u.Properties) delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &u.Stage) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &u.Tags) delete(rawMsg, key) @@ -14414,6 +24374,9 @@ func (u *URIFileJobInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URIFileJobOutput. func (u URIFileJobOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "assetName", u.AssetName) + populate(objectMap, "assetVersion", u.AssetVersion) + populate(objectMap, "autoDeleteSetting", u.AutoDeleteSetting) populate(objectMap, "description", u.Description) objectMap["jobOutputType"] = JobOutputTypeURIFile populate(objectMap, "mode", u.Mode) @@ -14430,6 +24393,15 @@ func (u *URIFileJobOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "assetName": + err = unpopulate(val, "AssetName", &u.AssetName) + delete(rawMsg, key) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &u.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &u.AutoDeleteSetting) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &u.Description) delete(rawMsg, key) @@ -14453,12 +24425,15 @@ func (u *URIFileJobOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URIFolderDataVersion. func (u URIFolderDataVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "autoDeleteSetting", u.AutoDeleteSetting) objectMap["dataType"] = DataTypeURIFolder populate(objectMap, "dataUri", u.DataURI) populate(objectMap, "description", u.Description) + populate(objectMap, "intellectualProperty", u.IntellectualProperty) populate(objectMap, "isAnonymous", u.IsAnonymous) populate(objectMap, "isArchived", u.IsArchived) populate(objectMap, "properties", u.Properties) + populate(objectMap, "stage", u.Stage) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) } @@ -14472,6 +24447,9 @@ func (u *URIFolderDataVersion) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &u.AutoDeleteSetting) + delete(rawMsg, key) case "dataType": err = unpopulate(val, "DataType", &u.DataType) delete(rawMsg, key) @@ -14481,6 +24459,9 @@ func (u *URIFolderDataVersion) UnmarshalJSON(data []byte) error { case "description": err = unpopulate(val, "Description", &u.Description) delete(rawMsg, key) + case "intellectualProperty": + err = unpopulate(val, "IntellectualProperty", &u.IntellectualProperty) + delete(rawMsg, key) case "isAnonymous": err = unpopulate(val, "IsAnonymous", &u.IsAnonymous) delete(rawMsg, key) @@ -14490,6 +24471,9 @@ func (u *URIFolderDataVersion) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &u.Properties) delete(rawMsg, key) + case "stage": + err = unpopulate(val, "Stage", &u.Stage) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &u.Tags) delete(rawMsg, key) @@ -14543,6 +24527,9 @@ func (u *URIFolderJobInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URIFolderJobOutput. func (u URIFolderJobOutput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "assetName", u.AssetName) + populate(objectMap, "assetVersion", u.AssetVersion) + populate(objectMap, "autoDeleteSetting", u.AutoDeleteSetting) populate(objectMap, "description", u.Description) objectMap["jobOutputType"] = JobOutputTypeURIFolder populate(objectMap, "mode", u.Mode) @@ -14559,6 +24546,15 @@ func (u *URIFolderJobOutput) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "assetName": + err = unpopulate(val, "AssetName", &u.AssetName) + delete(rawMsg, key) + case "assetVersion": + err = unpopulate(val, "AssetVersion", &u.AssetVersion) + delete(rawMsg, key) + case "autoDeleteSetting": + err = unpopulate(val, "AutoDeleteSetting", &u.AutoDeleteSetting) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &u.Description) delete(rawMsg, key) @@ -14801,6 +24797,60 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserCreatedAcrAccount. +func (u UserCreatedAcrAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "armResourceId", u.ArmResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserCreatedAcrAccount. +func (u *UserCreatedAcrAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "armResourceId": + err = unpopulate(val, "ArmResourceID", &u.ArmResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserCreatedStorageAccount. +func (u UserCreatedStorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "armResourceId", u.ArmResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserCreatedStorageAccount. +func (u *UserCreatedStorageAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "armResourceId": + err = unpopulate(val, "ArmResourceID", &u.ArmResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserIdentity. func (u UserIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14833,10 +24883,12 @@ func (u UsernamePasswordAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([] objectMap := make(map[string]any) objectMap["authType"] = ConnectionAuthTypeUsernamePassword populate(objectMap, "category", u.Category) + populate(objectMap, "createdByWorkspaceArmId", u.CreatedByWorkspaceArmID) populate(objectMap, "credentials", u.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", u.ExpiryTime) + populate(objectMap, "isSharedToAll", u.IsSharedToAll) + populateAny(objectMap, "metadata", u.Metadata) populate(objectMap, "target", u.Target) - populate(objectMap, "value", u.Value) - populate(objectMap, "valueFormat", u.ValueFormat) return json.Marshal(objectMap) } @@ -14855,17 +24907,23 @@ func (u *UsernamePasswordAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(da case "category": err = unpopulate(val, "Category", &u.Category) delete(rawMsg, key) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &u.CreatedByWorkspaceArmID) + delete(rawMsg, key) case "credentials": err = unpopulate(val, "Credentials", &u.Credentials) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &u.Target) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &u.ExpiryTime) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &u.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &u.Metadata) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &u.ValueFormat) + case "target": + err = unpopulate(val, "Target", &u.Target) delete(rawMsg, key) } if err != nil { @@ -14880,11 +24938,11 @@ func (v VirtualMachine) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "computeLocation", v.ComputeLocation) objectMap["computeType"] = ComputeTypeVirtualMachine - populateTimeRFC3339(objectMap, "createdOn", v.CreatedOn) + populateDateTimeRFC3339(objectMap, "createdOn", v.CreatedOn) populate(objectMap, "description", v.Description) populate(objectMap, "disableLocalAuth", v.DisableLocalAuth) populate(objectMap, "isAttachedCompute", v.IsAttachedCompute) - populateTimeRFC3339(objectMap, "modifiedOn", v.ModifiedOn) + populateDateTimeRFC3339(objectMap, "modifiedOn", v.ModifiedOn) populate(objectMap, "properties", v.Properties) populate(objectMap, "provisioningErrors", v.ProvisioningErrors) populate(objectMap, "provisioningState", v.ProvisioningState) @@ -14908,7 +24966,7 @@ func (v *VirtualMachine) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ComputeType", &v.ComputeType) delete(rawMsg, key) case "createdOn": - err = unpopulateTimeRFC3339(val, "CreatedOn", &v.CreatedOn) + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &v.CreatedOn) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &v.Description) @@ -14920,7 +24978,7 @@ func (v *VirtualMachine) UnmarshalJSON(data []byte) error { err = unpopulate(val, "IsAttachedCompute", &v.IsAttachedCompute) delete(rawMsg, key) case "modifiedOn": - err = unpopulateTimeRFC3339(val, "ModifiedOn", &v.ModifiedOn) + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &v.ModifiedOn) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &v.Properties) @@ -15234,11 +25292,125 @@ func (v *VirtualMachineSizeListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VolumeDefinition. +func (v VolumeDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bind", v.Bind) + populate(objectMap, "consistency", v.Consistency) + populate(objectMap, "readOnly", v.ReadOnly) + populate(objectMap, "source", v.Source) + populate(objectMap, "target", v.Target) + populate(objectMap, "tmpfs", v.Tmpfs) + populate(objectMap, "type", v.Type) + populate(objectMap, "volume", v.Volume) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeDefinition. +func (v *VolumeDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bind": + err = unpopulate(val, "Bind", &v.Bind) + delete(rawMsg, key) + case "consistency": + err = unpopulate(val, "Consistency", &v.Consistency) + delete(rawMsg, key) + case "readOnly": + err = unpopulate(val, "ReadOnly", &v.ReadOnly) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &v.Source) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &v.Target) + delete(rawMsg, key) + case "tmpfs": + err = unpopulate(val, "Tmpfs", &v.Tmpfs) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + case "volume": + err = unpopulate(val, "Volume", &v.Volume) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeOptions. +func (v VolumeOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nocopy", v.Nocopy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeOptions. +func (v *VolumeOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nocopy": + err = unpopulate(val, "Nocopy", &v.Nocopy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eventType", w.EventType) + objectMap["webhookType"] = w.WebhookType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Webhook. +func (w *Webhook) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eventType": + err = unpopulate(val, "EventType", &w.EventType) + delete(rawMsg, key) + case "webhookType": + err = unpopulate(val, "WebhookType", &w.WebhookType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Workspace. func (w Workspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", w.ID) populate(objectMap, "identity", w.Identity) + populate(objectMap, "kind", w.Kind) populate(objectMap, "location", w.Location) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) @@ -15264,6 +25436,9 @@ func (w *Workspace) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &w.Identity) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &w.Kind) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &w.Location) delete(rawMsg, key) @@ -15293,6 +25468,64 @@ func (w *Workspace) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionAPIKey. +func (w WorkspaceConnectionAPIKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", w.Key) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceConnectionAPIKey. +func (w *WorkspaceConnectionAPIKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &w.Key) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionAccessKey. +func (w WorkspaceConnectionAccessKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessKeyId", w.AccessKeyID) + populate(objectMap, "secretAccessKey", w.SecretAccessKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceConnectionAccessKey. +func (w *WorkspaceConnectionAccessKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessKeyId": + err = unpopulate(val, "AccessKeyID", &w.AccessKeyID) + delete(rawMsg, key) + case "secretAccessKey": + err = unpopulate(val, "SecretAccessKey", &w.SecretAccessKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionManagedIdentity. func (w WorkspaceConnectionManagedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15356,9 +25589,11 @@ func (w WorkspaceConnectionPropertiesV2) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["authType"] = w.AuthType populate(objectMap, "category", w.Category) + populate(objectMap, "createdByWorkspaceArmId", w.CreatedByWorkspaceArmID) + populateDateTimeRFC3339(objectMap, "expiryTime", w.ExpiryTime) + populate(objectMap, "isSharedToAll", w.IsSharedToAll) + populateAny(objectMap, "metadata", w.Metadata) populate(objectMap, "target", w.Target) - populate(objectMap, "value", w.Value) - populate(objectMap, "valueFormat", w.ValueFormat) return json.Marshal(objectMap) } @@ -15377,14 +25612,20 @@ func (w *WorkspaceConnectionPropertiesV2) UnmarshalJSON(data []byte) error { case "category": err = unpopulate(val, "Category", &w.Category) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &w.Target) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &w.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &w.ExpiryTime) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &w.ValueFormat) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &w.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &w.Metadata) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &w.Target) delete(rawMsg, key) } if err != nil { @@ -15468,6 +25709,41 @@ func (w *WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult) Unmarsh return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionServicePrincipal. +func (w WorkspaceConnectionServicePrincipal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", w.ClientID) + populate(objectMap, "clientSecret", w.ClientSecret) + populate(objectMap, "tenantId", w.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceConnectionServicePrincipal. +func (w *WorkspaceConnectionServicePrincipal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &w.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &w.ClientSecret) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &w.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionSharedAccessSignature. func (w WorkspaceConnectionSharedAccessSignature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15495,6 +25771,33 @@ func (w *WorkspaceConnectionSharedAccessSignature) UnmarshalJSON(data []byte) er return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionUpdateParameter. +func (w WorkspaceConnectionUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceConnectionUpdateParameter. +func (w *WorkspaceConnectionUpdateParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + w.Properties, err = unmarshalWorkspaceConnectionPropertiesV2Classification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionUsernamePassword. func (w WorkspaceConnectionUsernamePassword) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15526,6 +25829,37 @@ func (w *WorkspaceConnectionUsernamePassword) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceHubConfig. +func (w WorkspaceHubConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalWorkspaceStorageAccounts", w.AdditionalWorkspaceStorageAccounts) + populate(objectMap, "defaultWorkspaceResourceGroup", w.DefaultWorkspaceResourceGroup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceHubConfig. +func (w *WorkspaceHubConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalWorkspaceStorageAccounts": + err = unpopulate(val, "AdditionalWorkspaceStorageAccounts", &w.AdditionalWorkspaceStorageAccounts) + delete(rawMsg, key) + case "defaultWorkspaceResourceGroup": + err = unpopulate(val, "DefaultWorkspaceResourceGroup", &w.DefaultWorkspaceResourceGroup) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceListResult. func (w WorkspaceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15557,19 +25891,58 @@ func (w *WorkspaceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspacePrivateEndpointResource. +func (w WorkspacePrivateEndpointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + populate(objectMap, "subnetArmId", w.SubnetArmID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePrivateEndpointResource. +func (w *WorkspacePrivateEndpointResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "subnetArmId": + err = unpopulate(val, "SubnetArmID", &w.SubnetArmID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allowPublicAccessWhenBehindVnet", w.AllowPublicAccessWhenBehindVnet) populate(objectMap, "applicationInsights", w.ApplicationInsights) + populate(objectMap, "associatedWorkspaces", w.AssociatedWorkspaces) + populate(objectMap, "containerRegistries", w.ContainerRegistries) populate(objectMap, "containerRegistry", w.ContainerRegistry) populate(objectMap, "description", w.Description) populate(objectMap, "discoveryUrl", w.DiscoveryURL) + populate(objectMap, "enableDataIsolation", w.EnableDataIsolation) populate(objectMap, "encryption", w.Encryption) + populate(objectMap, "existingWorkspaces", w.ExistingWorkspaces) + populate(objectMap, "featureStoreSettings", w.FeatureStoreSettings) populate(objectMap, "friendlyName", w.FriendlyName) populate(objectMap, "hbiWorkspace", w.HbiWorkspace) + populate(objectMap, "hubResourceId", w.HubResourceID) populate(objectMap, "imageBuildCompute", w.ImageBuildCompute) populate(objectMap, "keyVault", w.KeyVault) + populate(objectMap, "keyVaults", w.KeyVaults) + populate(objectMap, "managedNetwork", w.ManagedNetwork) populate(objectMap, "mlFlowTrackingUri", w.MlFlowTrackingURI) populate(objectMap, "notebookInfo", w.NotebookInfo) populate(objectMap, "primaryUserAssignedIdentity", w.PrimaryUserAssignedIdentity) @@ -15577,13 +25950,18 @@ func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "privateLinkCount", w.PrivateLinkCount) populate(objectMap, "provisioningState", w.ProvisioningState) populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) + populate(objectMap, "serverlessComputeSettings", w.ServerlessComputeSettings) populate(objectMap, "serviceManagedResourcesSettings", w.ServiceManagedResourcesSettings) populate(objectMap, "serviceProvisionedResourceGroup", w.ServiceProvisionedResourceGroup) populate(objectMap, "sharedPrivateLinkResources", w.SharedPrivateLinkResources) + populate(objectMap, "softDeleteRetentionInDays", w.SoftDeleteRetentionInDays) populate(objectMap, "storageAccount", w.StorageAccount) + populate(objectMap, "storageAccounts", w.StorageAccounts) populate(objectMap, "storageHnsEnabled", w.StorageHnsEnabled) + populate(objectMap, "systemDatastoresAuthMode", w.SystemDatastoresAuthMode) populate(objectMap, "tenantId", w.TenantID) populate(objectMap, "v1LegacyMode", w.V1LegacyMode) + populate(objectMap, "workspaceHubConfig", w.WorkspaceHubConfig) populate(objectMap, "workspaceId", w.WorkspaceID) return json.Marshal(objectMap) } @@ -15603,6 +25981,12 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { case "applicationInsights": err = unpopulate(val, "ApplicationInsights", &w.ApplicationInsights) delete(rawMsg, key) + case "associatedWorkspaces": + err = unpopulate(val, "AssociatedWorkspaces", &w.AssociatedWorkspaces) + delete(rawMsg, key) + case "containerRegistries": + err = unpopulate(val, "ContainerRegistries", &w.ContainerRegistries) + delete(rawMsg, key) case "containerRegistry": err = unpopulate(val, "ContainerRegistry", &w.ContainerRegistry) delete(rawMsg, key) @@ -15612,21 +25996,39 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { case "discoveryUrl": err = unpopulate(val, "DiscoveryURL", &w.DiscoveryURL) delete(rawMsg, key) + case "enableDataIsolation": + err = unpopulate(val, "EnableDataIsolation", &w.EnableDataIsolation) + delete(rawMsg, key) case "encryption": err = unpopulate(val, "Encryption", &w.Encryption) delete(rawMsg, key) + case "existingWorkspaces": + err = unpopulate(val, "ExistingWorkspaces", &w.ExistingWorkspaces) + delete(rawMsg, key) + case "featureStoreSettings": + err = unpopulate(val, "FeatureStoreSettings", &w.FeatureStoreSettings) + delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &w.FriendlyName) delete(rawMsg, key) case "hbiWorkspace": err = unpopulate(val, "HbiWorkspace", &w.HbiWorkspace) delete(rawMsg, key) + case "hubResourceId": + err = unpopulate(val, "HubResourceID", &w.HubResourceID) + delete(rawMsg, key) case "imageBuildCompute": err = unpopulate(val, "ImageBuildCompute", &w.ImageBuildCompute) delete(rawMsg, key) case "keyVault": err = unpopulate(val, "KeyVault", &w.KeyVault) delete(rawMsg, key) + case "keyVaults": + err = unpopulate(val, "KeyVaults", &w.KeyVaults) + delete(rawMsg, key) + case "managedNetwork": + err = unpopulate(val, "ManagedNetwork", &w.ManagedNetwork) + delete(rawMsg, key) case "mlFlowTrackingUri": err = unpopulate(val, "MlFlowTrackingURI", &w.MlFlowTrackingURI) delete(rawMsg, key) @@ -15648,6 +26050,9 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &w.PublicNetworkAccess) delete(rawMsg, key) + case "serverlessComputeSettings": + err = unpopulate(val, "ServerlessComputeSettings", &w.ServerlessComputeSettings) + delete(rawMsg, key) case "serviceManagedResourcesSettings": err = unpopulate(val, "ServiceManagedResourcesSettings", &w.ServiceManagedResourcesSettings) delete(rawMsg, key) @@ -15657,18 +26062,30 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { case "sharedPrivateLinkResources": err = unpopulate(val, "SharedPrivateLinkResources", &w.SharedPrivateLinkResources) delete(rawMsg, key) + case "softDeleteRetentionInDays": + err = unpopulate(val, "SoftDeleteRetentionInDays", &w.SoftDeleteRetentionInDays) + delete(rawMsg, key) case "storageAccount": err = unpopulate(val, "StorageAccount", &w.StorageAccount) delete(rawMsg, key) + case "storageAccounts": + err = unpopulate(val, "StorageAccounts", &w.StorageAccounts) + delete(rawMsg, key) case "storageHnsEnabled": err = unpopulate(val, "StorageHnsEnabled", &w.StorageHnsEnabled) delete(rawMsg, key) + case "systemDatastoresAuthMode": + err = unpopulate(val, "SystemDatastoresAuthMode", &w.SystemDatastoresAuthMode) + delete(rawMsg, key) case "tenantId": err = unpopulate(val, "TenantID", &w.TenantID) delete(rawMsg, key) case "v1LegacyMode": err = unpopulate(val, "V1LegacyMode", &w.V1LegacyMode) delete(rawMsg, key) + case "workspaceHubConfig": + err = unpopulate(val, "WorkspaceHubConfig", &w.WorkspaceHubConfig) + delete(rawMsg, key) case "workspaceId": err = unpopulate(val, "WorkspaceID", &w.WorkspaceID) delete(rawMsg, key) @@ -15686,11 +26103,18 @@ func (w WorkspacePropertiesUpdateParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "applicationInsights", w.ApplicationInsights) populate(objectMap, "containerRegistry", w.ContainerRegistry) populate(objectMap, "description", w.Description) + populate(objectMap, "enableDataIsolation", w.EnableDataIsolation) + populate(objectMap, "encryption", w.Encryption) + populate(objectMap, "featureStoreSettings", w.FeatureStoreSettings) populate(objectMap, "friendlyName", w.FriendlyName) populate(objectMap, "imageBuildCompute", w.ImageBuildCompute) + populate(objectMap, "managedNetwork", w.ManagedNetwork) populate(objectMap, "primaryUserAssignedIdentity", w.PrimaryUserAssignedIdentity) populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) + populate(objectMap, "serverlessComputeSettings", w.ServerlessComputeSettings) populate(objectMap, "serviceManagedResourcesSettings", w.ServiceManagedResourcesSettings) + populate(objectMap, "softDeleteRetentionInDays", w.SoftDeleteRetentionInDays) + populate(objectMap, "v1LegacyMode", w.V1LegacyMode) return json.Marshal(objectMap) } @@ -15712,21 +26136,42 @@ func (w *WorkspacePropertiesUpdateParameters) UnmarshalJSON(data []byte) error { case "description": err = unpopulate(val, "Description", &w.Description) delete(rawMsg, key) + case "enableDataIsolation": + err = unpopulate(val, "EnableDataIsolation", &w.EnableDataIsolation) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &w.Encryption) + delete(rawMsg, key) + case "featureStoreSettings": + err = unpopulate(val, "FeatureStoreSettings", &w.FeatureStoreSettings) + delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &w.FriendlyName) delete(rawMsg, key) case "imageBuildCompute": err = unpopulate(val, "ImageBuildCompute", &w.ImageBuildCompute) delete(rawMsg, key) + case "managedNetwork": + err = unpopulate(val, "ManagedNetwork", &w.ManagedNetwork) + delete(rawMsg, key) case "primaryUserAssignedIdentity": err = unpopulate(val, "PrimaryUserAssignedIdentity", &w.PrimaryUserAssignedIdentity) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &w.PublicNetworkAccess) delete(rawMsg, key) + case "serverlessComputeSettings": + err = unpopulate(val, "ServerlessComputeSettings", &w.ServerlessComputeSettings) + delete(rawMsg, key) case "serviceManagedResourcesSettings": err = unpopulate(val, "ServiceManagedResourcesSettings", &w.ServiceManagedResourcesSettings) delete(rawMsg, key) + case "softDeleteRetentionInDays": + err = unpopulate(val, "SoftDeleteRetentionInDays", &w.SoftDeleteRetentionInDays) + delete(rawMsg, key) + case "v1LegacyMode": + err = unpopulate(val, "V1LegacyMode", &w.V1LegacyMode) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go index e8e3ab245fb7..3d25453cecd0 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type ModelVersionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewModelVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ModelVersionsClient, error) { - cl, err := arm.NewClient(moduleName+".ModelVersionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewModelVersionsClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Create or update version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. @@ -57,18 +56,25 @@ func NewModelVersionsClient(subscriptionID string, credential azcore.TokenCreden // - options - ModelVersionsClientCreateOrUpdateOptions contains the optional parameters for the ModelVersionsClient.CreateOrUpdate // method. func (client *ModelVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body ModelVersion, options *ModelVersionsClientCreateOrUpdateOptions) (ModelVersionsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "ModelVersionsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) if err != nil { return ModelVersionsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ModelVersionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ModelVersionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ModelVersionsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,10 +105,13 @@ func (client *ModelVersionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,23 +126,29 @@ func (client *ModelVersionsClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Delete version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - version - Version identifier. This is case-sensitive. // - options - ModelVersionsClientDeleteOptions contains the optional parameters for the ModelVersionsClient.Delete method. func (client *ModelVersionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ModelVersionsClientDeleteOptions) (ModelVersionsClientDeleteResponse, error) { + var err error + const operationName = "ModelVersionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return ModelVersionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ModelVersionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ModelVersionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ModelVersionsClientDeleteResponse{}, err } return ModelVersionsClientDeleteResponse{}, nil } @@ -166,7 +181,7 @@ func (client *ModelVersionsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,25 +190,32 @@ func (client *ModelVersionsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. This is case-sensitive. // - version - Version identifier. This is case-sensitive. // - options - ModelVersionsClientGetOptions contains the optional parameters for the ModelVersionsClient.Get method. func (client *ModelVersionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, options *ModelVersionsClientGetOptions) (ModelVersionsClientGetResponse, error) { + var err error + const operationName = "ModelVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, version, options) if err != nil { return ModelVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ModelVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ModelVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ModelVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -224,7 +246,7 @@ func (client *ModelVersionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,7 +263,7 @@ func (client *ModelVersionsClient) getHandleResponse(resp *http.Response) (Model // NewListPager - List model versions. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Model name. This is case-sensitive. @@ -252,25 +274,20 @@ func (client *ModelVersionsClient) NewListPager(resourceGroupName string, worksp return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ModelVersionsClientListResponse) (ModelVersionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ModelVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + }, nil) if err != nil { return ModelVersionsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ModelVersionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ModelVersionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -298,7 +315,7 @@ func (client *ModelVersionsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } @@ -329,6 +346,9 @@ func (client *ModelVersionsClient) listCreateRequest(ctx context.Context, resour if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,3 +362,185 @@ func (client *ModelVersionsClient) listHandleResponse(resp *http.Response) (Mode } return result, nil } + +// BeginPackage - Model Version Package operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Package operation request body. +// - options - ModelVersionsClientBeginPackageOptions contains the optional parameters for the ModelVersionsClient.BeginPackage +// method. +func (client *ModelVersionsClient) BeginPackage(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body PackageRequest, options *ModelVersionsClientBeginPackageOptions) (*runtime.Poller[ModelVersionsClientPackageResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.packageOperation(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ModelVersionsClientPackageResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ModelVersionsClientPackageResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Package - Model Version Package operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ModelVersionsClient) packageOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body PackageRequest, options *ModelVersionsClientBeginPackageOptions) (*http.Response, error) { + var err error + const operationName = "ModelVersionsClient.BeginPackage" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.packageCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// packageCreateRequest creates the Package request. +func (client *ModelVersionsClient) packageCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body PackageRequest, options *ModelVersionsClientBeginPackageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/package" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginPublish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Container name. +// - version - Version identifier. +// - body - Destination registry info +// - options - ModelVersionsClientBeginPublishOptions contains the optional parameters for the ModelVersionsClient.BeginPublish +// method. +func (client *ModelVersionsClient) BeginPublish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *ModelVersionsClientBeginPublishOptions) (*runtime.Poller[ModelVersionsClientPublishResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.publish(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ModelVersionsClientPublishResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ModelVersionsClientPublishResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Publish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ModelVersionsClient) publish(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *ModelVersionsClientBeginPublishOptions) (*http.Response, error) { + var err error + const operationName = "ModelVersionsClient.BeginPublish" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.publishCreateRequest(ctx, resourceGroupName, workspaceName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// publishCreateRequest creates the Publish request. +func (client *ModelVersionsClient) publishCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, version string, body DestinationAsset, options *ModelVersionsClientBeginPublishOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name}/versions/{version}/publish" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client_example_test.go deleted file mode 100644 index c327dab98706..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/list.json -func ExampleModelVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewModelVersionsClient().NewListPager("test-rg", "my-aml-workspace", "string", &armmachinelearning.ModelVersionsClientListOptions{Skip: nil, - OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Version: to.Ptr("string"), - Description: to.Ptr("string"), - Offset: to.Ptr[int32](1), - Tags: to.Ptr("string"), - Properties: to.Ptr("string"), - Feed: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ModelVersionResourceArmPaginatedResult = armmachinelearning.ModelVersionResourceArmPaginatedResult{ - // Value: []*armmachinelearning.ModelVersion{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ModelVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // Flavors: map[string]*armmachinelearning.FlavorData{ - // "string": &armmachinelearning.FlavorData{ - // Data: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // }, - // }, - // ModelType: to.Ptr("CustomModel"), - // ModelURI: to.Ptr("string"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/delete.json -func ExampleModelVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewModelVersionsClient().Delete(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/get.json -func ExampleModelVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewModelVersionsClient().Get(ctx, "test-rg", "my-aml-workspace", "string", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ModelVersion = armmachinelearning.ModelVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ModelVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // Flavors: map[string]*armmachinelearning.FlavorData{ - // "string": &armmachinelearning.FlavorData{ - // Data: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // }, - // }, - // ModelType: to.Ptr("CustomModel"), - // ModelURI: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ModelVersion/createOrUpdate.json -func ExampleModelVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewModelVersionsClient().CreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", "string", armmachinelearning.ModelVersion{ - Properties: &armmachinelearning.ModelVersionProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - IsAnonymous: to.Ptr(false), - Flavors: map[string]*armmachinelearning.FlavorData{ - "string": { - Data: map[string]*string{ - "string": to.Ptr("string"), - }, - }, - }, - ModelType: to.Ptr("CustomModel"), - ModelURI: to.Ptr("string"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ModelVersion = armmachinelearning.ModelVersion{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Properties: &armmachinelearning.ModelVersionProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // IsAnonymous: to.Ptr(false), - // Flavors: map[string]*armmachinelearning.FlavorData{ - // "string": &armmachinelearning.FlavorData{ - // Data: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // }, - // }, - // ModelType: to.Ptr("CustomModel"), - // ModelURI: to.Ptr("string"), - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client.go index 7cebb1f4793b..18f1afa20d3f 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type OnlineDeploymentsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOnlineDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OnlineDeploymentsClient, error) { - cl, err := arm.NewClient(moduleName+".OnlineDeploymentsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewOnlineDeploymentsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Create or update Inference Endpoint Deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name. @@ -62,29 +61,41 @@ func (client *OnlineDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[OnlineDeploymentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineDeploymentsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineDeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineDeploymentsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Create or update Inference Endpoint Deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineDeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body OnlineDeployment, options *OnlineDeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "OnlineDeploymentsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -115,16 +126,19 @@ func (client *OnlineDeploymentsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Inference Endpoint Deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name. @@ -137,29 +151,41 @@ func (client *OnlineDeploymentsClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[OnlineDeploymentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineDeploymentsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineDeploymentsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineDeploymentsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Delete Inference Endpoint Deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineDeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "OnlineDeploymentsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -190,7 +216,7 @@ func (client *OnlineDeploymentsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,25 +225,32 @@ func (client *OnlineDeploymentsClient) deleteCreateRequest(ctx context.Context, // Get - Get Inference Deployment Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name. // - deploymentName - Inference Endpoint Deployment name. // - options - OnlineDeploymentsClientGetOptions contains the optional parameters for the OnlineDeploymentsClient.Get method. func (client *OnlineDeploymentsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, options *OnlineDeploymentsClientGetOptions) (OnlineDeploymentsClientGetResponse, error) { + var err error + const operationName = "OnlineDeploymentsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) if err != nil { return OnlineDeploymentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OnlineDeploymentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineDeploymentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OnlineDeploymentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -248,7 +281,7 @@ func (client *OnlineDeploymentsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +299,7 @@ func (client *OnlineDeploymentsClient) getHandleResponse(resp *http.Response) (O // GetLogs - Polls an Endpoint operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name. @@ -275,18 +308,25 @@ func (client *OnlineDeploymentsClient) getHandleResponse(resp *http.Response) (O // - options - OnlineDeploymentsClientGetLogsOptions contains the optional parameters for the OnlineDeploymentsClient.GetLogs // method. func (client *OnlineDeploymentsClient) GetLogs(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body DeploymentLogsRequest, options *OnlineDeploymentsClientGetLogsOptions) (OnlineDeploymentsClientGetLogsResponse, error) { + var err error + const operationName = "OnlineDeploymentsClient.GetLogs" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getLogsCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) if err != nil { return OnlineDeploymentsClientGetLogsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OnlineDeploymentsClientGetLogsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineDeploymentsClientGetLogsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OnlineDeploymentsClientGetLogsResponse{}, err } - return client.getLogsHandleResponse(resp) + resp, err := client.getLogsHandleResponse(httpResp) + return resp, err } // getLogsCreateRequest creates the GetLogs request. @@ -317,10 +357,13 @@ func (client *OnlineDeploymentsClient) getLogsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // getLogsHandleResponse handles the GetLogs response. @@ -334,7 +377,7 @@ func (client *OnlineDeploymentsClient) getLogsHandleResponse(resp *http.Response // NewListPager - List Inference Endpoint Deployments. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name. @@ -346,25 +389,20 @@ func (client *OnlineDeploymentsClient) NewListPager(resourceGroupName string, wo return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *OnlineDeploymentsClientListResponse) (OnlineDeploymentsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return OnlineDeploymentsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OnlineDeploymentsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) + }, nil) if err != nil { return OnlineDeploymentsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineDeploymentsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -392,7 +430,7 @@ func (client *OnlineDeploymentsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } @@ -418,7 +456,7 @@ func (client *OnlineDeploymentsClient) listHandleResponse(resp *http.Response) ( // NewListSKUsPager - List Inference Endpoint Deployment Skus. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Inference endpoint name. @@ -431,25 +469,20 @@ func (client *OnlineDeploymentsClient) NewListSKUsPager(resourceGroupName string return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *OnlineDeploymentsClientListSKUsResponse) (OnlineDeploymentsClientListSKUsResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listSKUsCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return OnlineDeploymentsClientListSKUsResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OnlineDeploymentsClient.NewListSKUsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listSKUsCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, options) + }, nil) if err != nil { return OnlineDeploymentsClientListSKUsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineDeploymentsClientListSKUsResponse{}, runtime.NewResponseError(resp) - } return client.listSKUsHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -481,7 +514,7 @@ func (client *OnlineDeploymentsClient) listSKUsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Count != nil { reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) } @@ -505,7 +538,7 @@ func (client *OnlineDeploymentsClient) listSKUsHandleResponse(resp *http.Respons // BeginUpdate - Update Online Deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. @@ -519,29 +552,40 @@ func (client *OnlineDeploymentsClient) BeginUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[OnlineDeploymentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineDeploymentsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineDeploymentsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineDeploymentsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Update - Update Online Deployment (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineDeploymentsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, deploymentName string, body PartialMinimalTrackedResourceWithSKU, options *OnlineDeploymentsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "OnlineDeploymentsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, deploymentName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -572,8 +616,11 @@ func (client *OnlineDeploymentsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client_example_test.go deleted file mode 100644 index 382daf130b86..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client_example_test.go +++ /dev/null @@ -1,1017 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/list.json -func ExampleOnlineDeploymentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOnlineDeploymentsClient().NewListPager("test-rg", "my-aml-workspace", "testEndpointName", &armmachinelearning.OnlineDeploymentsClientListOptions{OrderBy: to.Ptr("string"), - Top: to.Ptr[int32](1), - Skip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OnlineDeploymentTrackedResourceArmPaginatedResult = armmachinelearning.OnlineDeploymentTrackedResourceArmPaginatedResult{ - // Value: []*armmachinelearning.OnlineDeployment{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.KubernetesOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeKubernetes), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // ContainerResourceRequirements: &armmachinelearning.ContainerResourceRequirements{ - // ContainerResourceLimits: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // ContainerResourceRequests: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/delete.json -func ExampleOnlineDeploymentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineDeploymentsClient().BeginDelete(ctx, "testrg123", "workspace123", "testEndpoint", "testDeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json -func ExampleOnlineDeploymentsClient_Get_getKubernetesOnlineDeployment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOnlineDeploymentsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineDeployment = armmachinelearning.OnlineDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.KubernetesOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeKubernetes), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // ContainerResourceRequirements: &armmachinelearning.ContainerResourceRequirements{ - // ContainerResourceLimits: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // ContainerResourceRequests: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json -func ExampleOnlineDeploymentsClient_Get_getManagedOnlineDeployment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOnlineDeploymentsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineDeployment = armmachinelearning.OnlineDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.ManagedOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeManaged), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // ReadinessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](30), - // InitialDelay: to.Ptr("PT1S"), - // Period: to.Ptr("PT10S"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT2S"), - // }, - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json -func ExampleOnlineDeploymentsClient_BeginUpdate_updateKubernetesOnlineDeployment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineDeploymentsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearning.PartialMinimalTrackedResourceWithSKU{ - Tags: map[string]*string{}, - SKU: &armmachinelearning.PartialSKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineDeployment = armmachinelearning.OnlineDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.KubernetesOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeKubernetes), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // ContainerResourceRequirements: &armmachinelearning.ContainerResourceRequirements{ - // ContainerResourceLimits: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // ContainerResourceRequests: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/update.json -func ExampleOnlineDeploymentsClient_BeginUpdate_updateManagedOnlineDeployment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineDeploymentsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearning.PartialMinimalTrackedResourceWithSKU{ - Tags: map[string]*string{}, - SKU: &armmachinelearning.PartialSKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineDeployment = armmachinelearning.OnlineDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.ManagedOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeManaged), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // ReadinessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](30), - // InitialDelay: to.Ptr("PT1S"), - // Period: to.Ptr("PT10S"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT2S"), - // }, - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json -func ExampleOnlineDeploymentsClient_BeginCreateOrUpdate_createOrUpdateKubernetesOnlineDeployment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineDeploymentsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearning.OnlineDeployment{ - Location: to.Ptr("string"), - Tags: map[string]*string{}, - Identity: &armmachinelearning.ManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - "string": {}, - }, - }, - Kind: to.Ptr("string"), - Properties: &armmachinelearning.KubernetesOnlineDeployment{ - Description: to.Ptr("string"), - CodeConfiguration: &armmachinelearning.CodeConfiguration{ - CodeID: to.Ptr("string"), - ScoringScript: to.Ptr("string"), - }, - EnvironmentID: to.Ptr("string"), - EnvironmentVariables: map[string]*string{ - "string": to.Ptr("string"), - }, - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - AppInsightsEnabled: to.Ptr(false), - EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeKubernetes), - InstanceType: to.Ptr("string"), - LivenessProbe: &armmachinelearning.ProbeSettings{ - FailureThreshold: to.Ptr[int32](1), - InitialDelay: to.Ptr("PT5M"), - Period: to.Ptr("PT5M"), - SuccessThreshold: to.Ptr[int32](1), - Timeout: to.Ptr("PT5M"), - }, - Model: to.Ptr("string"), - ModelMountPath: to.Ptr("string"), - RequestSettings: &armmachinelearning.OnlineRequestSettings{ - MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - MaxQueueWait: to.Ptr("PT5M"), - RequestTimeout: to.Ptr("PT5M"), - }, - ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - }, - ContainerResourceRequirements: &armmachinelearning.ContainerResourceRequirements{ - ContainerResourceLimits: &armmachinelearning.ContainerResourceSettings{ - CPU: to.Ptr("\"1\""), - Gpu: to.Ptr("\"1\""), - Memory: to.Ptr("\"2Gi\""), - }, - ContainerResourceRequests: &armmachinelearning.ContainerResourceSettings{ - CPU: to.Ptr("\"1\""), - Gpu: to.Ptr("\"1\""), - Memory: to.Ptr("\"2Gi\""), - }, - }, - }, - SKU: &armmachinelearning.SKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineDeployment = armmachinelearning.OnlineDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.KubernetesOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeKubernetes), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // ContainerResourceRequirements: &armmachinelearning.ContainerResourceRequirements{ - // ContainerResourceLimits: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // ContainerResourceRequests: &armmachinelearning.ContainerResourceSettings{ - // CPU: to.Ptr("\"1\""), - // Gpu: to.Ptr("\"1\""), - // Memory: to.Ptr("\"2Gi\""), - // }, - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json -func ExampleOnlineDeploymentsClient_BeginCreateOrUpdate_createOrUpdateManagedOnlineDeployment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineDeploymentsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", armmachinelearning.OnlineDeployment{ - Location: to.Ptr("string"), - Tags: map[string]*string{}, - Identity: &armmachinelearning.ManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - "string": {}, - }, - }, - Kind: to.Ptr("string"), - Properties: &armmachinelearning.ManagedOnlineDeployment{ - Description: to.Ptr("string"), - CodeConfiguration: &armmachinelearning.CodeConfiguration{ - CodeID: to.Ptr("string"), - ScoringScript: to.Ptr("string"), - }, - EnvironmentID: to.Ptr("string"), - EnvironmentVariables: map[string]*string{ - "string": to.Ptr("string"), - }, - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - AppInsightsEnabled: to.Ptr(false), - EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeManaged), - InstanceType: to.Ptr("string"), - LivenessProbe: &armmachinelearning.ProbeSettings{ - FailureThreshold: to.Ptr[int32](1), - InitialDelay: to.Ptr("PT5M"), - Period: to.Ptr("PT5M"), - SuccessThreshold: to.Ptr[int32](1), - Timeout: to.Ptr("PT5M"), - }, - Model: to.Ptr("string"), - ModelMountPath: to.Ptr("string"), - ReadinessProbe: &armmachinelearning.ProbeSettings{ - FailureThreshold: to.Ptr[int32](30), - InitialDelay: to.Ptr("PT1S"), - Period: to.Ptr("PT10S"), - SuccessThreshold: to.Ptr[int32](1), - Timeout: to.Ptr("PT2S"), - }, - RequestSettings: &armmachinelearning.OnlineRequestSettings{ - MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - MaxQueueWait: to.Ptr("PT5M"), - RequestTimeout: to.Ptr("PT5M"), - }, - ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - }, - }, - SKU: &armmachinelearning.SKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineDeployment = armmachinelearning.OnlineDeployment{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.ManagedOnlineDeployment{ - // Description: to.Ptr("string"), - // CodeConfiguration: &armmachinelearning.CodeConfiguration{ - // CodeID: to.Ptr("string"), - // ScoringScript: to.Ptr("string"), - // }, - // EnvironmentID: to.Ptr("string"), - // EnvironmentVariables: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // AppInsightsEnabled: to.Ptr(false), - // EndpointComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeManaged), - // InstanceType: to.Ptr("string"), - // LivenessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](1), - // InitialDelay: to.Ptr("PT5M"), - // Period: to.Ptr("PT5M"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT5M"), - // }, - // Model: to.Ptr("string"), - // ModelMountPath: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.DeploymentProvisioningStateSucceeded), - // ReadinessProbe: &armmachinelearning.ProbeSettings{ - // FailureThreshold: to.Ptr[int32](30), - // InitialDelay: to.Ptr("PT1S"), - // Period: to.Ptr("PT10S"), - // SuccessThreshold: to.Ptr[int32](1), - // Timeout: to.Ptr("PT2S"), - // }, - // RequestSettings: &armmachinelearning.OnlineRequestSettings{ - // MaxConcurrentRequestsPerInstance: to.Ptr[int32](1), - // MaxQueueWait: to.Ptr("PT5M"), - // RequestTimeout: to.Ptr("PT5M"), - // }, - // ScaleSettings: &armmachinelearning.DefaultScaleSettings{ - // ScaleType: to.Ptr(armmachinelearning.ScaleTypeDefault), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/getLogs.json -func ExampleOnlineDeploymentsClient_GetLogs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOnlineDeploymentsClient().GetLogs(ctx, "testrg123", "workspace123", "testEndpoint", "testDeployment", armmachinelearning.DeploymentLogsRequest{ - ContainerType: to.Ptr(armmachinelearning.ContainerTypeStorageInitializer), - Tail: to.Ptr[int32](0), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentLogs = armmachinelearning.DeploymentLogs{ - // Content: to.Ptr("string"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json -func ExampleOnlineDeploymentsClient_NewListSKUsPager_listKubernetesOnlineDeploymentSkus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOnlineDeploymentsClient().NewListSKUsPager("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", &armmachinelearning.OnlineDeploymentsClientListSKUsOptions{Count: to.Ptr[int32](1), - Skip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUResourceArmPaginatedResult = armmachinelearning.SKUResourceArmPaginatedResult{ - // Value: []*armmachinelearning.SKUResource{ - // { - // Capacity: &armmachinelearning.SKUCapacity{ - // Default: to.Ptr[int32](1), - // Maximum: to.Ptr[int32](1), - // Minimum: to.Ptr[int32](1), - // ScaleType: to.Ptr(armmachinelearning.SKUScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.MachineLearning.Services/endpoints/deployments"), - // SKU: &armmachinelearning.SKUSetting{ - // Name: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json -func ExampleOnlineDeploymentsClient_NewListSKUsPager_listManagedOnlineDeploymentSkus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOnlineDeploymentsClient().NewListSKUsPager("test-rg", "my-aml-workspace", "testEndpointName", "testDeploymentName", &armmachinelearning.OnlineDeploymentsClientListSKUsOptions{Count: to.Ptr[int32](1), - Skip: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SKUResourceArmPaginatedResult = armmachinelearning.SKUResourceArmPaginatedResult{ - // Value: []*armmachinelearning.SKUResource{ - // { - // Capacity: &armmachinelearning.SKUCapacity{ - // Default: to.Ptr[int32](1), - // Maximum: to.Ptr[int32](1), - // Minimum: to.Ptr[int32](1), - // ScaleType: to.Ptr(armmachinelearning.SKUScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.MachineLearning.Services/endpoints/deployments"), - // SKU: &armmachinelearning.SKUSetting{ - // Name: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client.go index 87bb16675658..0c1a57fd5270 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -34,7 +33,7 @@ type OnlineEndpointsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOnlineEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OnlineEndpointsClient, error) { - cl, err := arm.NewClient(moduleName+".OnlineEndpointsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -48,7 +47,7 @@ func NewOnlineEndpointsClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Create or update Online Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. @@ -61,29 +60,41 @@ func (client *OnlineEndpointsClient) BeginCreateOrUpdate(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[OnlineEndpointsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineEndpointsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineEndpointsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Create or update Online Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body OnlineEndpoint, options *OnlineEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "OnlineEndpointsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,16 +121,19 @@ func (client *OnlineEndpointsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Online Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. @@ -131,29 +145,41 @@ func (client *OnlineEndpointsClient) BeginDelete(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[OnlineEndpointsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineEndpointsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Delete Online Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "OnlineEndpointsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -180,7 +206,7 @@ func (client *OnlineEndpointsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,24 +215,31 @@ func (client *OnlineEndpointsClient) deleteCreateRequest(ctx context.Context, re // Get - Get Online Endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. // - options - OnlineEndpointsClientGetOptions contains the optional parameters for the OnlineEndpointsClient.Get method. func (client *OnlineEndpointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientGetOptions) (OnlineEndpointsClientGetResponse, error) { + var err error + const operationName = "OnlineEndpointsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return OnlineEndpointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OnlineEndpointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineEndpointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OnlineEndpointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -233,7 +266,7 @@ func (client *OnlineEndpointsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,28 +281,35 @@ func (client *OnlineEndpointsClient) getHandleResponse(resp *http.Response) (Onl return result, nil } -// GetToken - Retrieve a valid AAD token for an Endpoint using AMLToken-based authentication. +// GetToken - Retrieve a valid AML token for an Endpoint using AMLToken-based authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. // - options - OnlineEndpointsClientGetTokenOptions contains the optional parameters for the OnlineEndpointsClient.GetToken // method. func (client *OnlineEndpointsClient) GetToken(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientGetTokenOptions) (OnlineEndpointsClientGetTokenResponse, error) { + var err error + const operationName = "OnlineEndpointsClient.GetToken" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getTokenCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return OnlineEndpointsClientGetTokenResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OnlineEndpointsClientGetTokenResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineEndpointsClientGetTokenResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OnlineEndpointsClientGetTokenResponse{}, err } - return client.getTokenHandleResponse(resp) + resp, err := client.getTokenHandleResponse(httpResp) + return resp, err } // getTokenCreateRequest creates the GetToken request. @@ -296,7 +336,7 @@ func (client *OnlineEndpointsClient) getTokenCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,7 +353,7 @@ func (client *OnlineEndpointsClient) getTokenHandleResponse(resp *http.Response) // NewListPager - List Online Endpoints. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - OnlineEndpointsClientListOptions contains the optional parameters for the OnlineEndpointsClient.NewListPager @@ -324,25 +364,20 @@ func (client *OnlineEndpointsClient) NewListPager(resourceGroupName string, work return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *OnlineEndpointsClientListResponse) (OnlineEndpointsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return OnlineEndpointsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OnlineEndpointsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return OnlineEndpointsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineEndpointsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -366,7 +401,7 @@ func (client *OnlineEndpointsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Name != nil { reqQP.Set("name", *options.Name) } @@ -405,25 +440,32 @@ func (client *OnlineEndpointsClient) listHandleResponse(resp *http.Response) (On // ListKeys - List EndpointAuthKeys for an Endpoint using Key-based authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. // - options - OnlineEndpointsClientListKeysOptions contains the optional parameters for the OnlineEndpointsClient.ListKeys // method. func (client *OnlineEndpointsClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, options *OnlineEndpointsClientListKeysOptions) (OnlineEndpointsClientListKeysResponse, error) { + var err error + const operationName = "OnlineEndpointsClient.ListKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, options) if err != nil { return OnlineEndpointsClientListKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OnlineEndpointsClientListKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OnlineEndpointsClientListKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OnlineEndpointsClientListKeysResponse{}, err } - return client.listKeysHandleResponse(resp) + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err } // listKeysCreateRequest creates the ListKeys request. @@ -450,7 +492,7 @@ func (client *OnlineEndpointsClient) listKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -468,7 +510,7 @@ func (client *OnlineEndpointsClient) listKeysHandleResponse(resp *http.Response) // BeginRegenerateKeys - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. @@ -481,31 +523,41 @@ func (client *OnlineEndpointsClient) BeginRegenerateKeys(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientRegenerateKeysResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientRegenerateKeysResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineEndpointsClientRegenerateKeysResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineEndpointsClientRegenerateKeysResponse]{ + Tracer: client.internal.Tracer(), + }) } } // RegenerateKeys - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineEndpointsClient) regenerateKeys(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body RegenerateEndpointKeysRequest, options *OnlineEndpointsClientBeginRegenerateKeysOptions) (*http.Response, error) { + var err error + const operationName = "OnlineEndpointsClient.BeginRegenerateKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // regenerateKeysCreateRequest creates the RegenerateKeys request. @@ -532,16 +584,19 @@ func (client *OnlineEndpointsClient) regenerateKeysCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - Update Online Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Online Endpoint name. @@ -554,29 +609,40 @@ func (client *OnlineEndpointsClient) BeginUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[OnlineEndpointsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[OnlineEndpointsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OnlineEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Update - Update Online Endpoint (asynchronous). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *OnlineEndpointsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, endpointName string, body PartialMinimalTrackedResourceWithIdentity, options *OnlineEndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "OnlineEndpointsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, endpointName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -603,8 +669,11 @@ func (client *OnlineEndpointsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client_example_test.go deleted file mode 100644 index e4acc4d04e84..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client_example_test.go +++ /dev/null @@ -1,449 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/list.json -func ExampleOnlineEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOnlineEndpointsClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.OnlineEndpointsClientListOptions{Name: to.Ptr("string"), - Count: to.Ptr[int32](1), - ComputeType: to.Ptr(armmachinelearning.EndpointComputeTypeManaged), - Skip: nil, - Tags: to.Ptr("string"), - Properties: to.Ptr("string"), - OrderBy: to.Ptr(armmachinelearning.OrderStringCreatedAtDesc), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OnlineEndpointTrackedResourceArmPaginatedResult = armmachinelearning.OnlineEndpointTrackedResourceArmPaginatedResult{ - // Value: []*armmachinelearning.OnlineEndpoint{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.OnlineEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Compute: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.EndpointProvisioningStateSucceeded), - // Traffic: map[string]*int32{ - // "string": to.Ptr[int32](1), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/delete.json -func ExampleOnlineEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineEndpointsClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/get.json -func ExampleOnlineEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOnlineEndpointsClient().Get(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineEndpoint = armmachinelearning.OnlineEndpoint{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.OnlineEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Compute: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.EndpointProvisioningStateSucceeded), - // Traffic: map[string]*int32{ - // "string": to.Ptr[int32](1), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/update.json -func ExampleOnlineEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineEndpointsClient().BeginUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearning.PartialMinimalTrackedResourceWithIdentity{ - Tags: map[string]*string{}, - Identity: &armmachinelearning.PartialManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]any{ - "string": map[string]any{}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineEndpoint = armmachinelearning.OnlineEndpoint{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.OnlineEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Compute: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.EndpointProvisioningStateSucceeded), - // Traffic: map[string]*int32{ - // "string": to.Ptr[int32](1), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/createOrUpdate.json -func ExampleOnlineEndpointsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineEndpointsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearning.OnlineEndpoint{ - Location: to.Ptr("string"), - Tags: map[string]*string{}, - Identity: &armmachinelearning.ManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - "string": {}, - }, - }, - Kind: to.Ptr("string"), - Properties: &armmachinelearning.OnlineEndpointProperties{ - Description: to.Ptr("string"), - AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Compute: to.Ptr("string"), - Traffic: map[string]*int32{ - "string": to.Ptr[int32](1), - }, - }, - SKU: &armmachinelearning.SKU{ - Name: to.Ptr("string"), - Capacity: to.Ptr[int32](1), - Family: to.Ptr("string"), - Size: to.Ptr("string"), - Tier: to.Ptr(armmachinelearning.SKUTierFree), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OnlineEndpoint = armmachinelearning.OnlineEndpoint{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser), - // }, - // Location: to.Ptr("string"), - // Tags: map[string]*string{ - // }, - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "string": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Kind: to.Ptr("string"), - // Properties: &armmachinelearning.OnlineEndpointProperties{ - // Description: to.Ptr("string"), - // AuthMode: to.Ptr(armmachinelearning.EndpointAuthModeAMLToken), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // ScoringURI: to.Ptr("https://www.contoso.com/example"), - // SwaggerURI: to.Ptr("https://www.contoso.com/example"), - // Compute: to.Ptr("string"), - // ProvisioningState: to.Ptr(armmachinelearning.EndpointProvisioningStateSucceeded), - // Traffic: map[string]*int32{ - // "string": to.Ptr[int32](1), - // }, - // }, - // SKU: &armmachinelearning.SKU{ - // Name: to.Ptr("string"), - // Capacity: to.Ptr[int32](1), - // Family: to.Ptr("string"), - // Size: to.Ptr("string"), - // Tier: to.Ptr(armmachinelearning.SKUTierFree), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/listKeys.json -func ExampleOnlineEndpointsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOnlineEndpointsClient().ListKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EndpointAuthKeys = armmachinelearning.EndpointAuthKeys{ - // PrimaryKey: to.Ptr("string"), - // SecondaryKey: to.Ptr("string"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/regenerateKeys.json -func ExampleOnlineEndpointsClient_BeginRegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOnlineEndpointsClient().BeginRegenerateKeys(ctx, "test-rg", "my-aml-workspace", "testEndpointName", armmachinelearning.RegenerateEndpointKeysRequest{ - KeyType: to.Ptr(armmachinelearning.KeyTypePrimary), - KeyValue: to.Ptr("string"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/OnlineEndpoint/getToken.json -func ExampleOnlineEndpointsClient_GetToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOnlineEndpointsClient().GetToken(ctx, "test-rg", "my-aml-workspace", "testEndpointName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EndpointAuthToken = armmachinelearning.EndpointAuthToken{ - // AccessToken: to.Ptr("string"), - // ExpiryTimeUTC: to.Ptr[int64](1), - // RefreshAfterTimeUTC: to.Ptr[int64](1), - // TokenType: to.Ptr("string"), - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client.go index 72feb7c70761..074fd20aaf2f 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -28,7 +27,7 @@ type OperationsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -38,9 +37,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Lists all of the available Azure Machine Learning Workspaces REST API operations. +// NewListPager - Lists all of the available Azure Machine Learning Workspaces REST API operations // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -48,6 +47,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption return false }, Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager") req, err := client.listCreateRequest(ctx, options) if err != nil { return OperationsClientListResponse{}, err @@ -61,6 +61,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -72,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -81,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AmlOperationListResult); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client_example_test.go deleted file mode 100644 index 725beda489e9..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client_example_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/operationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AmlOperationListResult = armmachinelearning.AmlOperationListResult{ - // Value: []*armmachinelearning.AmlOperation{ - // { - // Name: to.Ptr("Microsoft.MachineLearningServices/workspaces/write"), - // Display: &armmachinelearning.AmlOperationDisplay{ - // Operation: to.Ptr("Create/Update Machine Learning workspaces"), - // Provider: to.Ptr("Microsoft MachineLearningServices"), - // Resource: to.Ptr("workspaces"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.MachineLearningServices/workspaces/delete"), - // Display: &armmachinelearning.AmlOperationDisplay{ - // Operation: to.Ptr("Delete Machine Learning workspaces"), - // Provider: to.Ptr("Microsoft MachineLearningServices"), - // Resource: to.Ptr("workspaces"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.MachineLearningServices/workspaces/listkeys/action"), - // Display: &armmachinelearning.AmlOperationDisplay{ - // Operation: to.Ptr("List workspace Keys"), - // Provider: to.Ptr("Microsoft MachineLearningServices"), - // Resource: to.Ptr("workspaces"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/options.go b/sdk/resourcemanager/machinelearning/armmachinelearning/options.go new file mode 100644 index 000000000000..6ee07c0654ba --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/options.go @@ -0,0 +1,1941 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +// BatchDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginCreateOrUpdate +// method. +type BatchDeploymentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchDeploymentsClientBeginDeleteOptions contains the optional parameters for the BatchDeploymentsClient.BeginDelete method. +type BatchDeploymentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchDeploymentsClientBeginUpdateOptions contains the optional parameters for the BatchDeploymentsClient.BeginUpdate method. +type BatchDeploymentsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchDeploymentsClientGetOptions contains the optional parameters for the BatchDeploymentsClient.Get method. +type BatchDeploymentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BatchDeploymentsClientListOptions contains the optional parameters for the BatchDeploymentsClient.NewListPager method. +type BatchDeploymentsClientListOptions struct { + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Top of list. + Top *int32 +} + +// BatchEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginCreateOrUpdate +// method. +type BatchEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchEndpointsClientBeginDeleteOptions contains the optional parameters for the BatchEndpointsClient.BeginDelete method. +type BatchEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchEndpointsClientBeginUpdateOptions contains the optional parameters for the BatchEndpointsClient.BeginUpdate method. +type BatchEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BatchEndpointsClientGetOptions contains the optional parameters for the BatchEndpointsClient.Get method. +type BatchEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BatchEndpointsClientListKeysOptions contains the optional parameters for the BatchEndpointsClient.ListKeys method. +type BatchEndpointsClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// BatchEndpointsClientListOptions contains the optional parameters for the BatchEndpointsClient.NewListPager method. +type BatchEndpointsClientListOptions struct { + // Number of endpoints to be retrieved in a page of results. + Count *int32 + + // Continuation token for pagination. + Skip *string +} + +// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate +// method. +type CapacityReservationGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete +// method. +type CapacityReservationGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get +// method. +type CapacityReservationGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager +// method. +type CapacityReservationGroupsClientListBySubscriptionOptions struct { + // Continuation token for pagination. + Skip *string +} + +// CapacityReservationGroupsClientListOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListPager +// method. +type CapacityReservationGroupsClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update +// method. +type CapacityReservationGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientCreateOrUpdateOptions contains the optional parameters for the CodeContainersClient.CreateOrUpdate +// method. +type CodeContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientDeleteOptions contains the optional parameters for the CodeContainersClient.Delete method. +type CodeContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientGetOptions contains the optional parameters for the CodeContainersClient.Get method. +type CodeContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// CodeContainersClientListOptions contains the optional parameters for the CodeContainersClient.NewListPager method. +type CodeContainersClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// CodeVersionsClientBeginPublishOptions contains the optional parameters for the CodeVersionsClient.BeginPublish method. +type CodeVersionsClientBeginPublishOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CodeVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the CodeVersionsClient.CreateOrGetStartPendingUpload +// method. +type CodeVersionsClientCreateOrGetStartPendingUploadOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientCreateOrUpdateOptions contains the optional parameters for the CodeVersionsClient.CreateOrUpdate method. +type CodeVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientDeleteOptions contains the optional parameters for the CodeVersionsClient.Delete method. +type CodeVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientGetOptions contains the optional parameters for the CodeVersionsClient.Get method. +type CodeVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CodeVersionsClientListOptions contains the optional parameters for the CodeVersionsClient.NewListPager method. +type CodeVersionsClientListOptions struct { + // If specified, return CodeVersion assets with specified content hash value, regardless of name + Hash *string + + // Hash algorithm version when listing by hash + HashVersion *string + + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Maximum number of records to return. + Top *int32 +} + +// ComponentContainersClientCreateOrUpdateOptions contains the optional parameters for the ComponentContainersClient.CreateOrUpdate +// method. +type ComponentContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ComponentContainersClientDeleteOptions contains the optional parameters for the ComponentContainersClient.Delete method. +type ComponentContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ComponentContainersClientGetOptions contains the optional parameters for the ComponentContainersClient.Get method. +type ComponentContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComponentContainersClientListOptions contains the optional parameters for the ComponentContainersClient.NewListPager method. +type ComponentContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// ComponentVersionsClientBeginPublishOptions contains the optional parameters for the ComponentVersionsClient.BeginPublish +// method. +type ComponentVersionsClientBeginPublishOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComponentVersionsClientCreateOrUpdateOptions contains the optional parameters for the ComponentVersionsClient.CreateOrUpdate +// method. +type ComponentVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ComponentVersionsClientDeleteOptions contains the optional parameters for the ComponentVersionsClient.Delete method. +type ComponentVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ComponentVersionsClientGetOptions contains the optional parameters for the ComponentVersionsClient.Get method. +type ComponentVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComponentVersionsClientListOptions contains the optional parameters for the ComponentVersionsClient.NewListPager method. +type ComponentVersionsClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Component stage. + Stage *string + + // Maximum number of records to return. + Top *int32 +} + +// ComputeClientBeginCreateOrUpdateOptions contains the optional parameters for the ComputeClient.BeginCreateOrUpdate method. +type ComputeClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginDeleteOptions contains the optional parameters for the ComputeClient.BeginDelete method. +type ComputeClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginResizeOptions contains the optional parameters for the ComputeClient.BeginResize method. +type ComputeClientBeginResizeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginRestartOptions contains the optional parameters for the ComputeClient.BeginRestart method. +type ComputeClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginStartOptions contains the optional parameters for the ComputeClient.BeginStart method. +type ComputeClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginStopOptions contains the optional parameters for the ComputeClient.BeginStop method. +type ComputeClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientBeginUpdateOptions contains the optional parameters for the ComputeClient.BeginUpdate method. +type ComputeClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ComputeClientGetAllowedResizeSizesOptions contains the optional parameters for the ComputeClient.GetAllowedResizeSizes +// method. +type ComputeClientGetAllowedResizeSizesOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientGetOptions contains the optional parameters for the ComputeClient.Get method. +type ComputeClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientListKeysOptions contains the optional parameters for the ComputeClient.ListKeys method. +type ComputeClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientListNodesOptions contains the optional parameters for the ComputeClient.NewListNodesPager method. +type ComputeClientListNodesOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientListOptions contains the optional parameters for the ComputeClient.NewListPager method. +type ComputeClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// ComputeClientUpdateCustomServicesOptions contains the optional parameters for the ComputeClient.UpdateCustomServices method. +type ComputeClientUpdateCustomServicesOptions struct { + // placeholder for future optional parameters +} + +// ComputeClientUpdateIdleShutdownSettingOptions contains the optional parameters for the ComputeClient.UpdateIdleShutdownSetting +// method. +type ComputeClientUpdateIdleShutdownSettingOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientCreateOrUpdateOptions contains the optional parameters for the DataContainersClient.CreateOrUpdate +// method. +type DataContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientDeleteOptions contains the optional parameters for the DataContainersClient.Delete method. +type DataContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientGetOptions contains the optional parameters for the DataContainersClient.Get method. +type DataContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataContainersClientListOptions contains the optional parameters for the DataContainersClient.NewListPager method. +type DataContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// DataVersionsClientBeginPublishOptions contains the optional parameters for the DataVersionsClient.BeginPublish method. +type DataVersionsClientBeginPublishOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DataVersionsClientCreateOrUpdateOptions contains the optional parameters for the DataVersionsClient.CreateOrUpdate method. +type DataVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DataVersionsClientDeleteOptions contains the optional parameters for the DataVersionsClient.Delete method. +type DataVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DataVersionsClientGetOptions contains the optional parameters for the DataVersionsClient.Get method. +type DataVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataVersionsClientListOptions contains the optional parameters for the DataVersionsClient.NewListPager method. +type DataVersionsClientListOptions struct { + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // Please choose OrderBy value from ['createdtime', 'modifiedtime'] + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // data stage + Stage *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + + // 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 + Top *int32 +} + +// DatastoresClientCreateOrUpdateOptions contains the optional parameters for the DatastoresClient.CreateOrUpdate method. +type DatastoresClientCreateOrUpdateOptions struct { + // Flag to skip validation. + SkipValidation *bool +} + +// DatastoresClientDeleteOptions contains the optional parameters for the DatastoresClient.Delete method. +type DatastoresClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DatastoresClientGetOptions contains the optional parameters for the DatastoresClient.Get method. +type DatastoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatastoresClientListOptions contains the optional parameters for the DatastoresClient.NewListPager method. +type DatastoresClientListOptions struct { + // Maximum number of results to return. + Count *int32 + + // Filter down to the workspace default datastore. + IsDefault *bool + + // Names of datastores to return. + Names []string + + // Order by property (createdtime | modifiedtime | name). + OrderBy *string + + // Order by property in ascending order. + OrderByAsc *bool + + // Text to search for in the datastore names. + SearchText *string + + // Continuation token for pagination. + Skip *string +} + +// DatastoresClientListSecretsOptions contains the optional parameters for the DatastoresClient.ListSecrets method. +type DatastoresClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentContainersClient.CreateOrUpdate +// method. +type EnvironmentContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientDeleteOptions contains the optional parameters for the EnvironmentContainersClient.Delete method. +type EnvironmentContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientGetOptions contains the optional parameters for the EnvironmentContainersClient.Get method. +type EnvironmentContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentContainersClientListOptions contains the optional parameters for the EnvironmentContainersClient.NewListPager +// method. +type EnvironmentContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// EnvironmentVersionsClientBeginPublishOptions contains the optional parameters for the EnvironmentVersionsClient.BeginPublish +// method. +type EnvironmentVersionsClientBeginPublishOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EnvironmentVersionsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentVersionsClient.CreateOrUpdate +// method. +type EnvironmentVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentVersionsClientDeleteOptions contains the optional parameters for the EnvironmentVersionsClient.Delete method. +type EnvironmentVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentVersionsClientGetOptions contains the optional parameters for the EnvironmentVersionsClient.Get method. +type EnvironmentVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// EnvironmentVersionsClientListOptions contains the optional parameters for the EnvironmentVersionsClient.NewListPager method. +type EnvironmentVersionsClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Stage for including/excluding (for example) archived entities. Takes priority over listViewType + Stage *string + + // Maximum number of records to return. + Top *int32 +} + +// FeaturesClientGetOptions contains the optional parameters for the FeaturesClient.Get method. +type FeaturesClientGetOptions struct { + // placeholder for future optional parameters +} + +// FeaturesClientListOptions contains the optional parameters for the FeaturesClient.NewListPager method. +type FeaturesClientListOptions struct { + // Description of the featureset. + Description *string + + // feature name. + FeatureName *string + + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // Page size. + PageSize *int32 + + // Continuation token for pagination. + Skip *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string +} + +// FeaturesetContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturesetContainersClient.BeginCreateOrUpdate +// method. +type FeaturesetContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturesetContainersClientBeginDeleteOptions contains the optional parameters for the FeaturesetContainersClient.BeginDelete +// method. +type FeaturesetContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturesetContainersClientGetEntityOptions contains the optional parameters for the FeaturesetContainersClient.GetEntity +// method. +type FeaturesetContainersClientGetEntityOptions struct { + // placeholder for future optional parameters +} + +// FeaturesetContainersClientListOptions contains the optional parameters for the FeaturesetContainersClient.NewListPager +// method. +type FeaturesetContainersClientListOptions struct { + // createdBy user name + CreatedBy *string + + // description for the feature set + Description *string + + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // name for the featureset + Name *string + + // page size + PageSize *int32 + + // Continuation token for pagination. + Skip *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string +} + +// FeaturesetVersionsClientBeginBackfillOptions contains the optional parameters for the FeaturesetVersionsClient.BeginBackfill +// method. +type FeaturesetVersionsClientBeginBackfillOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturesetVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturesetVersionsClient.BeginCreateOrUpdate +// method. +type FeaturesetVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturesetVersionsClientBeginDeleteOptions contains the optional parameters for the FeaturesetVersionsClient.BeginDelete +// method. +type FeaturesetVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturesetVersionsClientGetOptions contains the optional parameters for the FeaturesetVersionsClient.Get method. +type FeaturesetVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FeaturesetVersionsClientListOptions contains the optional parameters for the FeaturesetVersionsClient.NewListPager method. +type FeaturesetVersionsClientListOptions struct { + // createdBy user name + CreatedBy *string + + // description for the feature set version + Description *string + + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // page size + PageSize *int32 + + // Continuation token for pagination. + Skip *string + + // Specifies the featurestore stage + Stage *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + + // featureset version + Version *string + + // name for the featureset version + VersionName *string +} + +// FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturestoreEntityContainersClient.BeginCreateOrUpdate +// method. +type FeaturestoreEntityContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturestoreEntityContainersClientBeginDeleteOptions contains the optional parameters for the FeaturestoreEntityContainersClient.BeginDelete +// method. +type FeaturestoreEntityContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturestoreEntityContainersClientGetEntityOptions contains the optional parameters for the FeaturestoreEntityContainersClient.GetEntity +// method. +type FeaturestoreEntityContainersClientGetEntityOptions struct { + // placeholder for future optional parameters +} + +// FeaturestoreEntityContainersClientListOptions contains the optional parameters for the FeaturestoreEntityContainersClient.NewListPager +// method. +type FeaturestoreEntityContainersClientListOptions struct { + // createdBy user name + CreatedBy *string + + // description for the featurestore entity + Description *string + + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // name for the featurestore entity + Name *string + + // page size + PageSize *int32 + + // Continuation token for pagination. + Skip *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string +} + +// FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.BeginCreateOrUpdate +// method. +type FeaturestoreEntityVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturestoreEntityVersionsClientBeginDeleteOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.BeginDelete +// method. +type FeaturestoreEntityVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FeaturestoreEntityVersionsClientGetOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.Get +// method. +type FeaturestoreEntityVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FeaturestoreEntityVersionsClientListOptions contains the optional parameters for the FeaturestoreEntityVersionsClient.NewListPager +// method. +type FeaturestoreEntityVersionsClientListOptions struct { + // createdBy user name + CreatedBy *string + + // description for the feature entity version + Description *string + + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // page size + PageSize *int32 + + // Continuation token for pagination. + Skip *string + + // Specifies the featurestore stage + Stage *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + + // featurestore entity version + Version *string + + // name for the featurestore entity version + VersionName *string +} + +// InferenceEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the InferenceEndpointsClient.BeginCreateOrUpdate +// method. +type InferenceEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferenceEndpointsClientBeginDeleteOptions contains the optional parameters for the InferenceEndpointsClient.BeginDelete +// method. +type InferenceEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferenceEndpointsClientBeginUpdateOptions contains the optional parameters for the InferenceEndpointsClient.BeginUpdate +// method. +type InferenceEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferenceEndpointsClientGetOptions contains the optional parameters for the InferenceEndpointsClient.Get method. +type InferenceEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InferenceEndpointsClientListOptions contains the optional parameters for the InferenceEndpointsClient.NewListPager method. +type InferenceEndpointsClientListOptions struct { + // Number of InferenceEndpoint to be retrieved in a page of results. + Count *int32 + + // The option to order the response. + OrderBy *OrderString + + // A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties + // key=value Example: propKey1,propKey2,propKey3=value3 . + Properties *string + + // Continuation token for pagination. + Skip *string + + // A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: + // tagKey1,tagKey2,tagKey3=value3 . + Tags *string +} + +// InferenceGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InferenceGroupsClient.BeginCreateOrUpdate +// method. +type InferenceGroupsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferenceGroupsClientBeginDeleteOptions contains the optional parameters for the InferenceGroupsClient.BeginDelete method. +type InferenceGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferenceGroupsClientBeginUpdateOptions contains the optional parameters for the InferenceGroupsClient.BeginUpdate method. +type InferenceGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferenceGroupsClientGetOptions contains the optional parameters for the InferenceGroupsClient.Get method. +type InferenceGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InferenceGroupsClientGetStatusOptions contains the optional parameters for the InferenceGroupsClient.GetStatus method. +type InferenceGroupsClientGetStatusOptions struct { + // placeholder for future optional parameters +} + +// InferenceGroupsClientListOptions contains the optional parameters for the InferenceGroupsClient.NewListPager method. +type InferenceGroupsClientListOptions struct { + // Number of InferenceGroup to be retrieved in a page of results. + Count *int32 + + // The option to order the response. + OrderBy *OrderString + + // A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties + // key=value Example: propKey1,propKey2,propKey3=value3 . + Properties *string + + // Continuation token for pagination. + Skip *string + + // A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: + // tagKey1,tagKey2,tagKey3=value3 . + Tags *string +} + +// InferenceGroupsClientListSKUsOptions contains the optional parameters for the InferenceGroupsClient.NewListSKUsPager method. +type InferenceGroupsClientListSKUsOptions struct { + // Number of Skus to be retrieved in a page of results. + Count *int32 + + // Continuation token for pagination. + Skip *string +} + +// InferencePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InferencePoolsClient.BeginCreateOrUpdate +// method. +type InferencePoolsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferencePoolsClientBeginDeleteOptions contains the optional parameters for the InferencePoolsClient.BeginDelete method. +type InferencePoolsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferencePoolsClientBeginUpdateOptions contains the optional parameters for the InferencePoolsClient.BeginUpdate method. +type InferencePoolsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InferencePoolsClientGetOptions contains the optional parameters for the InferencePoolsClient.Get method. +type InferencePoolsClientGetOptions struct { + // placeholder for future optional parameters +} + +// InferencePoolsClientGetStatusOptions contains the optional parameters for the InferencePoolsClient.GetStatus method. +type InferencePoolsClientGetStatusOptions struct { + // placeholder for future optional parameters +} + +// InferencePoolsClientListOptions contains the optional parameters for the InferencePoolsClient.NewListPager method. +type InferencePoolsClientListOptions struct { + // Number of inferencePools to be retrieved in a page of results. + Count *int32 + + // The option to order the response. + OrderBy *OrderString + + // A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties + // key=value Example: propKey1,propKey2,propKey3=value3 . + Properties *string + + // Continuation token for pagination. + Skip *string + + // A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: + // tagKey1,tagKey2,tagKey3=value3 . + Tags *string +} + +// InferencePoolsClientListSKUsOptions contains the optional parameters for the InferencePoolsClient.NewListSKUsPager method. +type InferencePoolsClientListSKUsOptions struct { + // Number of Skus to be retrieved in a page of results. + Count *int32 + + // Continuation token for pagination. + Skip *string +} + +// JobsClientBeginCancelOptions contains the optional parameters for the JobsClient.BeginCancel method. +type JobsClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. +type JobsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. +type JobsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +type JobsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. +type JobsClientListOptions struct { + // Asset name the job's named output is registered with + AssetName *string + + // Type of job to be returned. + JobType *string + + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2 + Properties *string + + // The scheduled id for listing the job triggered from + ScheduleID *string + + // Indicator whether the job is scheduled job. + Scheduled *bool + + // Continuation token for pagination. + Skip *string + + // Jobs returned will have this tag key. + Tag *string +} + +// JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method. +type JobsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// LabelingJobsClientBeginCreateOrUpdateOptions contains the optional parameters for the LabelingJobsClient.BeginCreateOrUpdate +// method. +type LabelingJobsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LabelingJobsClientBeginExportLabelsOptions contains the optional parameters for the LabelingJobsClient.BeginExportLabels +// method. +type LabelingJobsClientBeginExportLabelsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LabelingJobsClientBeginResumeOptions contains the optional parameters for the LabelingJobsClient.BeginResume method. +type LabelingJobsClientBeginResumeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LabelingJobsClientDeleteOptions contains the optional parameters for the LabelingJobsClient.Delete method. +type LabelingJobsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// LabelingJobsClientGetOptions contains the optional parameters for the LabelingJobsClient.Get method. +type LabelingJobsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LabelingJobsClientListOptions contains the optional parameters for the LabelingJobsClient.NewListPager method. +type LabelingJobsClientListOptions struct { + // Continuation token for pagination. + Skip *string + + // Number of labeling jobs to return. + Top *int32 +} + +// LabelingJobsClientPauseOptions contains the optional parameters for the LabelingJobsClient.Pause method. +type LabelingJobsClientPauseOptions struct { + // placeholder for future optional parameters +} + +// ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions contains the optional parameters for the ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork +// method. +type ManagedNetworkProvisionsClientBeginProvisionManagedNetworkOptions struct { + // Managed Network Provisioning Options for a machine learning workspace. + Body *ManagedNetworkProvisionOptions + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate +// method. +type ManagedNetworkSettingsRuleClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedNetworkSettingsRuleClientBeginDeleteOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.BeginDelete +// method. +type ManagedNetworkSettingsRuleClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedNetworkSettingsRuleClientGetOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.Get +// method. +type ManagedNetworkSettingsRuleClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedNetworkSettingsRuleClientListOptions contains the optional parameters for the ManagedNetworkSettingsRuleClient.NewListPager +// method. +type ManagedNetworkSettingsRuleClientListOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientCreateOrUpdateOptions contains the optional parameters for the ModelContainersClient.CreateOrUpdate +// method. +type ModelContainersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientDeleteOptions contains the optional parameters for the ModelContainersClient.Delete method. +type ModelContainersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientGetOptions contains the optional parameters for the ModelContainersClient.Get method. +type ModelContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ModelContainersClientListOptions contains the optional parameters for the ModelContainersClient.NewListPager method. +type ModelContainersClientListOptions struct { + // Maximum number of results to return. + Count *int32 + + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// ModelVersionsClientBeginPackageOptions contains the optional parameters for the ModelVersionsClient.BeginPackage method. +type ModelVersionsClientBeginPackageOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ModelVersionsClientBeginPublishOptions contains the optional parameters for the ModelVersionsClient.BeginPublish method. +type ModelVersionsClientBeginPublishOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ModelVersionsClientCreateOrUpdateOptions contains the optional parameters for the ModelVersionsClient.CreateOrUpdate method. +type ModelVersionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ModelVersionsClientDeleteOptions contains the optional parameters for the ModelVersionsClient.Delete method. +type ModelVersionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ModelVersionsClientGetOptions contains the optional parameters for the ModelVersionsClient.Get method. +type ModelVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ModelVersionsClientListOptions contains the optional parameters for the ModelVersionsClient.NewListPager method. +type ModelVersionsClientListOptions struct { + // Model description. + Description *string + + // Name of the feed. + Feed *string + + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Number of initial results to skip. + Offset *int32 + + // Ordering of list. + OrderBy *string + + // Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2 + Properties *string + + // Continuation token for pagination. + Skip *string + + // Model stage + Stage *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + + // Maximum number of records to return. + Top *int32 + + // Model version. + Version *string +} + +// OnlineDeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginCreateOrUpdate +// method. +type OnlineDeploymentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineDeploymentsClientBeginDeleteOptions contains the optional parameters for the OnlineDeploymentsClient.BeginDelete +// method. +type OnlineDeploymentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineDeploymentsClientBeginUpdateOptions contains the optional parameters for the OnlineDeploymentsClient.BeginUpdate +// method. +type OnlineDeploymentsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineDeploymentsClientGetLogsOptions contains the optional parameters for the OnlineDeploymentsClient.GetLogs method. +type OnlineDeploymentsClientGetLogsOptions struct { + // placeholder for future optional parameters +} + +// OnlineDeploymentsClientGetOptions contains the optional parameters for the OnlineDeploymentsClient.Get method. +type OnlineDeploymentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OnlineDeploymentsClientListOptions contains the optional parameters for the OnlineDeploymentsClient.NewListPager method. +type OnlineDeploymentsClientListOptions struct { + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Top of list. + Top *int32 +} + +// OnlineDeploymentsClientListSKUsOptions contains the optional parameters for the OnlineDeploymentsClient.NewListSKUsPager +// method. +type OnlineDeploymentsClientListSKUsOptions struct { + // Number of Skus to be retrieved in a page of results. + Count *int32 + + // Continuation token for pagination. + Skip *string +} + +// OnlineEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginCreateOrUpdate +// method. +type OnlineEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientBeginDeleteOptions contains the optional parameters for the OnlineEndpointsClient.BeginDelete method. +type OnlineEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientBeginRegenerateKeysOptions contains the optional parameters for the OnlineEndpointsClient.BeginRegenerateKeys +// method. +type OnlineEndpointsClientBeginRegenerateKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientBeginUpdateOptions contains the optional parameters for the OnlineEndpointsClient.BeginUpdate method. +type OnlineEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OnlineEndpointsClientGetOptions contains the optional parameters for the OnlineEndpointsClient.Get method. +type OnlineEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OnlineEndpointsClientGetTokenOptions contains the optional parameters for the OnlineEndpointsClient.GetToken method. +type OnlineEndpointsClientGetTokenOptions struct { + // placeholder for future optional parameters +} + +// OnlineEndpointsClientListKeysOptions contains the optional parameters for the OnlineEndpointsClient.ListKeys method. +type OnlineEndpointsClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// OnlineEndpointsClientListOptions contains the optional parameters for the OnlineEndpointsClient.NewListPager method. +type OnlineEndpointsClientListOptions struct { + // EndpointComputeType to be filtered by. + ComputeType *EndpointComputeType + + // Number of endpoints to be retrieved in a page of results. + Count *int32 + + // Name of the endpoint. + Name *string + + // The option to order the response. + OrderBy *OrderString + + // A set of properties with which to filter the returned models. It is a comma separated string of properties key and/or properties + // key=value Example: propKey1,propKey2,propKey3=value3 . + Properties *string + + // Continuation token for pagination. + Skip *string + + // A set of tags with which to filter the returned models. It is a comma separated string of tags key or tags key=value. Example: + // tagKey1,tagKey2,tagKey3=value3 . + Tags *string +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate +// method. +type PrivateEndpointConnectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete +// method. +type PrivateEndpointConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager +// method. +type PrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager +// method. +type PrivateLinkResourcesClientListOptions struct { + // placeholder for future optional parameters +} + +// QuotasClientListOptions contains the optional parameters for the QuotasClient.NewListPager method. +type QuotasClientListOptions struct { + // placeholder for future optional parameters +} + +// QuotasClientUpdateOptions contains the optional parameters for the QuotasClient.Update method. +type QuotasClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistriesClient.BeginCreateOrUpdate +// method. +type RegistriesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistriesClientBeginDeleteOptions contains the optional parameters for the RegistriesClient.BeginDelete method. +type RegistriesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistriesClientBeginRemoveRegionsOptions contains the optional parameters for the RegistriesClient.BeginRemoveRegions +// method. +type RegistriesClientBeginRemoveRegionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method. +type RegistriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistriesClientListBySubscriptionOptions contains the optional parameters for the RegistriesClient.NewListBySubscriptionPager +// method. +type RegistriesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// RegistriesClientListOptions contains the optional parameters for the RegistriesClient.NewListPager method. +type RegistriesClientListOptions struct { + // placeholder for future optional parameters +} + +// RegistriesClientUpdateOptions contains the optional parameters for the RegistriesClient.Update method. +type RegistriesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RegistryCodeContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryCodeContainersClient.BeginCreateOrUpdate +// method. +type RegistryCodeContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryCodeContainersClientBeginDeleteOptions contains the optional parameters for the RegistryCodeContainersClient.BeginDelete +// method. +type RegistryCodeContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryCodeContainersClientGetOptions contains the optional parameters for the RegistryCodeContainersClient.Get method. +type RegistryCodeContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryCodeContainersClientListOptions contains the optional parameters for the RegistryCodeContainersClient.NewListPager +// method. +type RegistryCodeContainersClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// RegistryCodeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryCodeVersionsClient.BeginCreateOrUpdate +// method. +type RegistryCodeVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryCodeVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryCodeVersionsClient.BeginDelete +// method. +type RegistryCodeVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the RegistryCodeVersionsClient.CreateOrGetStartPendingUpload +// method. +type RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions struct { + // placeholder for future optional parameters +} + +// RegistryCodeVersionsClientGetOptions contains the optional parameters for the RegistryCodeVersionsClient.Get method. +type RegistryCodeVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryCodeVersionsClientListOptions contains the optional parameters for the RegistryCodeVersionsClient.NewListPager +// method. +type RegistryCodeVersionsClientListOptions struct { + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Maximum number of records to return. + Top *int32 +} + +// RegistryComponentContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryComponentContainersClient.BeginCreateOrUpdate +// method. +type RegistryComponentContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryComponentContainersClientBeginDeleteOptions contains the optional parameters for the RegistryComponentContainersClient.BeginDelete +// method. +type RegistryComponentContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryComponentContainersClientGetOptions contains the optional parameters for the RegistryComponentContainersClient.Get +// method. +type RegistryComponentContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryComponentContainersClientListOptions contains the optional parameters for the RegistryComponentContainersClient.NewListPager +// method. +type RegistryComponentContainersClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// RegistryComponentVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryComponentVersionsClient.BeginCreateOrUpdate +// method. +type RegistryComponentVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryComponentVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryComponentVersionsClient.BeginDelete +// method. +type RegistryComponentVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryComponentVersionsClientGetOptions contains the optional parameters for the RegistryComponentVersionsClient.Get +// method. +type RegistryComponentVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryComponentVersionsClientListOptions contains the optional parameters for the RegistryComponentVersionsClient.NewListPager +// method. +type RegistryComponentVersionsClientListOptions struct { + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Component stage. + Stage *string + + // Maximum number of records to return. + Top *int32 +} + +// RegistryDataContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryDataContainersClient.BeginCreateOrUpdate +// method. +type RegistryDataContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryDataContainersClientBeginDeleteOptions contains the optional parameters for the RegistryDataContainersClient.BeginDelete +// method. +type RegistryDataContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryDataContainersClientGetOptions contains the optional parameters for the RegistryDataContainersClient.Get method. +type RegistryDataContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryDataContainersClientListOptions contains the optional parameters for the RegistryDataContainersClient.NewListPager +// method. +type RegistryDataContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// RegistryDataReferencesClientGetBlobReferenceSASOptions contains the optional parameters for the RegistryDataReferencesClient.GetBlobReferenceSAS +// method. +type RegistryDataReferencesClientGetBlobReferenceSASOptions struct { + // placeholder for future optional parameters +} + +// RegistryDataVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryDataVersionsClient.BeginCreateOrUpdate +// method. +type RegistryDataVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryDataVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryDataVersionsClient.BeginDelete +// method. +type RegistryDataVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the RegistryDataVersionsClient.CreateOrGetStartPendingUpload +// method. +type RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions struct { + // placeholder for future optional parameters +} + +// RegistryDataVersionsClientGetOptions contains the optional parameters for the RegistryDataVersionsClient.Get method. +type RegistryDataVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryDataVersionsClientListOptions contains the optional parameters for the RegistryDataVersionsClient.NewListPager +// method. +type RegistryDataVersionsClientListOptions struct { + // [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All]View type for including/excluding (for example) archived + // entities. + ListViewType *ListViewType + + // Please choose OrderBy value from ['createdtime', 'modifiedtime'] + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + + // 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 + Top *int32 +} + +// RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryEnvironmentContainersClient.BeginCreateOrUpdate +// method. +type RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryEnvironmentContainersClientBeginDeleteOptions contains the optional parameters for the RegistryEnvironmentContainersClient.BeginDelete +// method. +type RegistryEnvironmentContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryEnvironmentContainersClientGetOptions contains the optional parameters for the RegistryEnvironmentContainersClient.Get +// method. +type RegistryEnvironmentContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryEnvironmentContainersClientListOptions contains the optional parameters for the RegistryEnvironmentContainersClient.NewListPager +// method. +type RegistryEnvironmentContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.BeginCreateOrUpdate +// method. +type RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryEnvironmentVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.BeginDelete +// method. +type RegistryEnvironmentVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryEnvironmentVersionsClientGetOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.Get +// method. +type RegistryEnvironmentVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryEnvironmentVersionsClientListOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.NewListPager +// method. +type RegistryEnvironmentVersionsClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Ordering of list. + OrderBy *string + + // Continuation token for pagination. + Skip *string + + // Stage for including/excluding (for example) archived entities. Takes priority over listViewType + Stage *string + + // Maximum number of records to return. + Top *int32 +} + +// RegistryModelContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryModelContainersClient.BeginCreateOrUpdate +// method. +type RegistryModelContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryModelContainersClientBeginDeleteOptions contains the optional parameters for the RegistryModelContainersClient.BeginDelete +// method. +type RegistryModelContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryModelContainersClientGetOptions contains the optional parameters for the RegistryModelContainersClient.Get method. +type RegistryModelContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryModelContainersClientListOptions contains the optional parameters for the RegistryModelContainersClient.NewListPager +// method. +type RegistryModelContainersClientListOptions struct { + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Continuation token for pagination. + Skip *string +} + +// RegistryModelVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryModelVersionsClient.BeginCreateOrUpdate +// method. +type RegistryModelVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryModelVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryModelVersionsClient.BeginDelete +// method. +type RegistryModelVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryModelVersionsClientBeginPackageOptions contains the optional parameters for the RegistryModelVersionsClient.BeginPackage +// method. +type RegistryModelVersionsClientBeginPackageOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the RegistryModelVersionsClient.CreateOrGetStartPendingUpload +// method. +type RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions struct { + // placeholder for future optional parameters +} + +// RegistryModelVersionsClientGetOptions contains the optional parameters for the RegistryModelVersionsClient.Get method. +type RegistryModelVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegistryModelVersionsClientListOptions contains the optional parameters for the RegistryModelVersionsClient.NewListPager +// method. +type RegistryModelVersionsClientListOptions struct { + // Model description. + Description *string + + // View type for including/excluding (for example) archived entities. + ListViewType *ListViewType + + // Ordering of list. + OrderBy *string + + // Comma-separated list of property names (and optionally values). Example: prop1,prop2=value2 + Properties *string + + // Continuation token for pagination. + Skip *string + + // Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2 + Tags *string + + // Maximum number of records to return. + Top *int32 + + // Version identifier. + Version *string +} + +// SchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SchedulesClient.BeginCreateOrUpdate +// method. +type SchedulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SchedulesClientBeginDeleteOptions contains the optional parameters for the SchedulesClient.BeginDelete method. +type SchedulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SchedulesClientGetOptions contains the optional parameters for the SchedulesClient.Get method. +type SchedulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SchedulesClientListOptions contains the optional parameters for the SchedulesClient.NewListPager method. +type SchedulesClientListOptions struct { + // Status filter for schedule. + ListViewType *ScheduleListViewType + + // Continuation token for pagination. + Skip *string +} + +// ServerlessEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerlessEndpointsClient.BeginCreateOrUpdate +// method. +type ServerlessEndpointsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerlessEndpointsClientBeginDeleteOptions contains the optional parameters for the ServerlessEndpointsClient.BeginDelete +// method. +type ServerlessEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerlessEndpointsClientBeginRegenerateKeysOptions contains the optional parameters for the ServerlessEndpointsClient.BeginRegenerateKeys +// method. +type ServerlessEndpointsClientBeginRegenerateKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerlessEndpointsClientBeginUpdateOptions contains the optional parameters for the ServerlessEndpointsClient.BeginUpdate +// method. +type ServerlessEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerlessEndpointsClientGetOptions contains the optional parameters for the ServerlessEndpointsClient.Get method. +type ServerlessEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerlessEndpointsClientGetStatusOptions contains the optional parameters for the ServerlessEndpointsClient.GetStatus +// method. +type ServerlessEndpointsClientGetStatusOptions struct { + // placeholder for future optional parameters +} + +// ServerlessEndpointsClientListKeysOptions contains the optional parameters for the ServerlessEndpointsClient.ListKeys method. +type ServerlessEndpointsClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// ServerlessEndpointsClientListOptions contains the optional parameters for the ServerlessEndpointsClient.NewListPager method. +type ServerlessEndpointsClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + +// UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. +type UsagesClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List method. +type VirtualMachineSizesClientListOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceConnectionsClientBeginTestConnectionOptions contains the optional parameters for the WorkspaceConnectionsClient.BeginTestConnection +// method. +type WorkspaceConnectionsClientBeginTestConnectionOptions struct { + // Workspace Connection object + Body *WorkspaceConnectionPropertiesV2BasicResource + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspaceConnectionsClientCreateOptions contains the optional parameters for the WorkspaceConnectionsClient.Create method. +type WorkspaceConnectionsClientCreateOptions struct { + // The object for creating or updating a new workspace connection + Body *WorkspaceConnectionPropertiesV2BasicResource +} + +// WorkspaceConnectionsClientDeleteOptions contains the optional parameters for the WorkspaceConnectionsClient.Delete method. +type WorkspaceConnectionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceConnectionsClientGetOptions contains the optional parameters for the WorkspaceConnectionsClient.Get method. +type WorkspaceConnectionsClientGetOptions struct { + // query parameter for which AOAI mode should be deployed + AoaiModelsToDeploy *string +} + +// WorkspaceConnectionsClientListOptions contains the optional parameters for the WorkspaceConnectionsClient.NewListPager +// method. +type WorkspaceConnectionsClientListOptions struct { + // Category of the workspace connection. + Category *string + + // Target of the workspace connection. + Target *string +} + +// WorkspaceConnectionsClientListSecretsOptions contains the optional parameters for the WorkspaceConnectionsClient.ListSecrets +// method. +type WorkspaceConnectionsClientListSecretsOptions struct { + // query parameter for which AOAI mode should be deployed + AoaiModelsToDeploy *string +} + +// WorkspaceConnectionsClientUpdateOptions contains the optional parameters for the WorkspaceConnectionsClient.Update method. +type WorkspaceConnectionsClientUpdateOptions struct { + // Parameters for workspace connection update. + Body *WorkspaceConnectionUpdateParameter +} + +// WorkspaceFeaturesClientListOptions contains the optional parameters for the WorkspaceFeaturesClient.NewListPager method. +type WorkspaceFeaturesClientListOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate +// method. +type WorkspacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. +type WorkspacesClientBeginDeleteOptions struct { + // Flag to indicate delete is a purge request. + ForceToPurge *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginDiagnoseOptions contains the optional parameters for the WorkspacesClient.BeginDiagnose method. +type WorkspacesClientBeginDiagnoseOptions struct { + // The parameter of diagnosing workspace health + Body *DiagnoseWorkspaceParameters + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginPrepareNotebookOptions contains the optional parameters for the WorkspacesClient.BeginPrepareNotebook +// method. +type WorkspacesClientBeginPrepareNotebookOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginResyncKeysOptions contains the optional parameters for the WorkspacesClient.BeginResyncKeys method. +type WorkspacesClientBeginResyncKeysOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. +type WorkspacesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. +type WorkspacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager +// method. +type WorkspacesClientListByResourceGroupOptions struct { + // Kind of workspace. + Kind *string + + // Continuation token for pagination. + Skip *string +} + +// WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager +// method. +type WorkspacesClientListBySubscriptionOptions struct { + // Kind of workspace. + Kind *string + + // Continuation token for pagination. + Skip *string +} + +// WorkspacesClientListKeysOptions contains the optional parameters for the WorkspacesClient.ListKeys method. +type WorkspacesClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListNotebookAccessTokenOptions contains the optional parameters for the WorkspacesClient.ListNotebookAccessToken +// method. +type WorkspacesClientListNotebookAccessTokenOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListNotebookKeysOptions contains the optional parameters for the WorkspacesClient.ListNotebookKeys method. +type WorkspacesClientListNotebookKeysOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the WorkspacesClient.ListOutboundNetworkDependenciesEndpoints +// method. +type WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListStorageAccountKeysOptions contains the optional parameters for the WorkspacesClient.ListStorageAccountKeys +// method. +type WorkspacesClientListStorageAccountKeysOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go b/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go index 0514343147e4..a4bd236b7031 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -30,7 +29,10 @@ func unmarshalAssetReferenceBaseClassification(rawMsg json.RawMessage) (AssetRef default: b = &AssetReferenceBase{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAutoMLVerticalClassification(rawMsg json.RawMessage) (AutoMLVerticalClassification, error) { @@ -66,7 +68,52 @@ func unmarshalAutoMLVerticalClassification(rawMsg json.RawMessage) (AutoMLVertic default: b = &AutoMLVertical{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalBaseEnvironmentSourceClassification(rawMsg json.RawMessage) (BaseEnvironmentSourceClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b BaseEnvironmentSourceClassification + switch m["baseEnvironmentSourceType"] { + case string(BaseEnvironmentSourceTypeEnvironmentAsset): + b = &BaseEnvironmentID{} + default: + b = &BaseEnvironmentSource{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalBatchDeploymentConfigurationClassification(rawMsg json.RawMessage) (BatchDeploymentConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b BatchDeploymentConfigurationClassification + switch m["deploymentConfigurationType"] { + case string(BatchDeploymentConfigurationTypePipelineComponent): + b = &BatchPipelineComponentDeploymentConfiguration{} + default: + b = &BatchDeploymentConfiguration{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalComputeClassification(rawMsg json.RawMessage) (ComputeClassification, error) { @@ -102,7 +149,10 @@ func unmarshalComputeClassification(rawMsg json.RawMessage) (ComputeClassificati default: b = &Compute{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalComputeSecretsClassification(rawMsg json.RawMessage) (ComputeSecretsClassification, error) { @@ -124,7 +174,144 @@ func unmarshalComputeSecretsClassification(rawMsg json.RawMessage) (ComputeSecre default: b = &ComputeSecrets{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalDataDriftMetricThresholdBaseClassification(rawMsg json.RawMessage) (DataDriftMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DataDriftMetricThresholdBaseClassification + switch m["dataType"] { + case string(MonitoringFeatureDataTypeCategorical): + b = &CategoricalDataDriftMetricThreshold{} + case string(MonitoringFeatureDataTypeNumerical): + b = &NumericalDataDriftMetricThreshold{} + default: + b = &DataDriftMetricThresholdBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalDataDriftMetricThresholdBaseClassificationArray(rawMsg json.RawMessage) ([]DataDriftMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]DataDriftMetricThresholdBaseClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalDataDriftMetricThresholdBaseClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalDataImportSourceClassification(rawMsg json.RawMessage) (DataImportSourceClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DataImportSourceClassification + switch m["sourceType"] { + case string(DataImportSourceTypeDatabase): + b = &DatabaseSource{} + case string(DataImportSourceTypeFileSystem): + b = &FileSystemSource{} + default: + b = &DataImportSource{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalDataQualityMetricThresholdBaseClassification(rawMsg json.RawMessage) (DataQualityMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DataQualityMetricThresholdBaseClassification + switch m["dataType"] { + case string(MonitoringFeatureDataTypeCategorical): + b = &CategoricalDataQualityMetricThreshold{} + case string(MonitoringFeatureDataTypeNumerical): + b = &NumericalDataQualityMetricThreshold{} + default: + b = &DataQualityMetricThresholdBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalDataQualityMetricThresholdBaseClassificationArray(rawMsg json.RawMessage) ([]DataQualityMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]DataQualityMetricThresholdBaseClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalDataQualityMetricThresholdBaseClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalDataReferenceCredentialClassification(rawMsg json.RawMessage) (DataReferenceCredentialClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DataReferenceCredentialClassification + switch m["credentialType"] { + case string(DataReferenceCredentialTypeDockerCredentials): + b = &DockerCredential{} + case string(DataReferenceCredentialTypeManagedIdentity): + b = &ManagedIdentityCredential{} + case string(DataReferenceCredentialTypeNoCredentials): + b = &AnonymousAccessCredential{} + case string(DataReferenceCredentialTypeSAS): + b = &SASCredential{} + default: + b = &DataReferenceCredential{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDataVersionBasePropertiesClassification(rawMsg json.RawMessage) (DataVersionBasePropertiesClassification, error) { @@ -146,7 +333,10 @@ func unmarshalDataVersionBasePropertiesClassification(rawMsg json.RawMessage) (D default: b = &DataVersionBaseProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDatastoreCredentialsClassification(rawMsg json.RawMessage) (DatastoreCredentialsClassification, error) { @@ -163,6 +353,10 @@ func unmarshalDatastoreCredentialsClassification(rawMsg json.RawMessage) (Datast b = &AccountKeyDatastoreCredentials{} case string(CredentialsTypeCertificate): b = &CertificateDatastoreCredentials{} + case string(CredentialsTypeKerberosKeytab): + b = &KerberosKeytabCredentials{} + case string(CredentialsTypeKerberosPassword): + b = &KerberosPasswordCredentials{} case string(CredentialsTypeNone): b = &NoneDatastoreCredentials{} case string(CredentialsTypeSas): @@ -172,7 +366,10 @@ func unmarshalDatastoreCredentialsClassification(rawMsg json.RawMessage) (Datast default: b = &DatastoreCredentials{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDatastorePropertiesClassification(rawMsg json.RawMessage) (DatastorePropertiesClassification, error) { @@ -193,10 +390,17 @@ func unmarshalDatastorePropertiesClassification(rawMsg json.RawMessage) (Datasto b = &AzureDataLakeGen2Datastore{} case string(DatastoreTypeAzureFile): b = &AzureFileDatastore{} + case string(DatastoreTypeHdfs): + b = &HdfsDatastore{} + case string(DatastoreTypeOneLake): + b = &OneLakeDatastore{} default: b = &DatastoreProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDatastoreSecretsClassification(rawMsg json.RawMessage) (DatastoreSecretsClassification, error) { @@ -213,6 +417,10 @@ func unmarshalDatastoreSecretsClassification(rawMsg json.RawMessage) (DatastoreS b = &AccountKeyDatastoreSecrets{} case string(SecretsTypeCertificate): b = &CertificateDatastoreSecrets{} + case string(SecretsTypeKerberosKeytab): + b = &KerberosKeytabSecrets{} + case string(SecretsTypeKerberosPassword): + b = &KerberosPasswordSecrets{} case string(SecretsTypeSas): b = &SasDatastoreSecrets{} case string(SecretsTypeServicePrincipal): @@ -220,7 +428,10 @@ func unmarshalDatastoreSecretsClassification(rawMsg json.RawMessage) (DatastoreS default: b = &DatastoreSecrets{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDistributionConfigurationClassification(rawMsg json.RawMessage) (DistributionConfigurationClassification, error) { @@ -237,12 +448,17 @@ func unmarshalDistributionConfigurationClassification(rawMsg json.RawMessage) (D b = &Mpi{} case string(DistributionTypePyTorch): b = &PyTorch{} + case string(DistributionTypeRay): + b = &Ray{} case string(DistributionTypeTensorFlow): b = &TensorFlow{} default: b = &DistributionConfiguration{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalEarlyTerminationPolicyClassification(rawMsg json.RawMessage) (EarlyTerminationPolicyClassification, error) { @@ -264,7 +480,35 @@ func unmarshalEarlyTerminationPolicyClassification(rawMsg json.RawMessage) (Earl default: b = &EarlyTerminationPolicy{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalExportSummaryClassification(rawMsg json.RawMessage) (ExportSummaryClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ExportSummaryClassification + switch m["format"] { + case string(ExportFormatTypeCSV): + b = &CSVExportSummary{} + case string(ExportFormatTypeCoco): + b = &CocoExportSummary{} + case string(ExportFormatTypeDataset): + b = &DatasetExportSummary{} + default: + b = &ExportSummary{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalForecastHorizonClassification(rawMsg json.RawMessage) (ForecastHorizonClassification, error) { @@ -284,7 +528,10 @@ func unmarshalForecastHorizonClassification(rawMsg json.RawMessage) (ForecastHor default: b = &ForecastHorizon{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalIdentityConfigurationClassification(rawMsg json.RawMessage) (IdentityConfigurationClassification, error) { @@ -306,7 +553,37 @@ func unmarshalIdentityConfigurationClassification(rawMsg json.RawMessage) (Ident default: b = &IdentityConfiguration{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalInferencingServerClassification(rawMsg json.RawMessage) (InferencingServerClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b InferencingServerClassification + switch m["serverType"] { + case string(InferencingServerTypeAzureMLBatch): + b = &AzureMLBatchInferencingServer{} + case string(InferencingServerTypeAzureMLOnline): + b = &AzureMLOnlineInferencingServer{} + case string(InferencingServerTypeCustom): + b = &CustomInferencingServer{} + case string(InferencingServerTypeTriton): + b = &TritonInferencingServer{} + default: + b = &InferencingServer{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalJobBasePropertiesClassification(rawMsg json.RawMessage) (JobBasePropertiesClassification, error) { @@ -323,14 +600,21 @@ func unmarshalJobBasePropertiesClassification(rawMsg json.RawMessage) (JobBasePr b = &AutoMLJob{} case string(JobTypeCommand): b = &CommandJob{} + case string(JobTypeLabeling): + b = &LabelingJobProperties{} case string(JobTypePipeline): b = &PipelineJob{} + case string(JobTypeSpark): + b = &SparkJob{} case string(JobTypeSweep): b = &SweepJob{} default: b = &JobBaseProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassification, error) { @@ -360,7 +644,10 @@ func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassifica default: b = &JobInput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalJobInputClassificationMap(rawMsg json.RawMessage) (map[string]JobInputClassification, error) { @@ -407,7 +694,10 @@ func unmarshalJobOutputClassification(rawMsg json.RawMessage) (JobOutputClassifi default: b = &JobOutput{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalJobOutputClassificationMap(rawMsg json.RawMessage) (map[string]JobOutputClassification, error) { @@ -429,6 +719,261 @@ func unmarshalJobOutputClassificationMap(rawMsg json.RawMessage) (map[string]Job return fMap, nil } +func unmarshalLabelingJobMediaPropertiesClassification(rawMsg json.RawMessage) (LabelingJobMediaPropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b LabelingJobMediaPropertiesClassification + switch m["mediaType"] { + case string(MediaTypeImage): + b = &LabelingJobImageProperties{} + case string(MediaTypeText): + b = &LabelingJobTextProperties{} + default: + b = &LabelingJobMediaProperties{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMLAssistConfigurationClassification(rawMsg json.RawMessage) (MLAssistConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MLAssistConfigurationClassification + switch m["mlAssist"] { + case string(MLAssistConfigurationTypeDisabled): + b = &MLAssistConfigurationDisabled{} + case string(MLAssistConfigurationTypeEnabled): + b = &MLAssistConfigurationEnabled{} + default: + b = &MLAssistConfiguration{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalModelPerformanceMetricThresholdBaseClassification(rawMsg json.RawMessage) (ModelPerformanceMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ModelPerformanceMetricThresholdBaseClassification + switch m["modelType"] { + case string(MonitoringModelTypeClassification): + b = &ClassificationModelPerformanceMetricThreshold{} + case string(MonitoringModelTypeRegression): + b = &RegressionModelPerformanceMetricThreshold{} + default: + b = &ModelPerformanceMetricThresholdBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMonitorComputeConfigurationBaseClassification(rawMsg json.RawMessage) (MonitorComputeConfigurationBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MonitorComputeConfigurationBaseClassification + switch m["computeType"] { + case string(MonitorComputeTypeServerlessSpark): + b = &MonitorServerlessSparkCompute{} + default: + b = &MonitorComputeConfigurationBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMonitorComputeIdentityBaseClassification(rawMsg json.RawMessage) (MonitorComputeIdentityBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MonitorComputeIdentityBaseClassification + switch m["computeIdentityType"] { + case string(MonitorComputeIdentityTypeAmlToken): + b = &AmlTokenComputeIdentity{} + case string(MonitorComputeIdentityTypeManagedIdentity): + b = &ManagedComputeIdentity{} + default: + b = &MonitorComputeIdentityBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMonitoringFeatureFilterBaseClassification(rawMsg json.RawMessage) (MonitoringFeatureFilterBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MonitoringFeatureFilterBaseClassification + switch m["filterType"] { + case string(MonitoringFeatureFilterTypeAllFeatures): + b = &AllFeatures{} + case string(MonitoringFeatureFilterTypeFeatureSubset): + b = &FeatureSubset{} + case string(MonitoringFeatureFilterTypeTopNByAttribution): + b = &TopNFeaturesByAttribution{} + default: + b = &MonitoringFeatureFilterBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMonitoringInputDataBaseClassification(rawMsg json.RawMessage) (MonitoringInputDataBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MonitoringInputDataBaseClassification + switch m["inputDataType"] { + case string(MonitoringInputDataTypeFixed): + b = &FixedInputData{} + case string(MonitoringInputDataTypeRolling): + b = &RollingInputData{} + case string(MonitoringInputDataTypeStatic): + b = &StaticInputData{} + default: + b = &MonitoringInputDataBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMonitoringInputDataBaseClassificationArray(rawMsg json.RawMessage) ([]MonitoringInputDataBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]MonitoringInputDataBaseClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalMonitoringInputDataBaseClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalMonitoringInputDataBaseClassificationMap(rawMsg json.RawMessage) (map[string]MonitoringInputDataBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]MonitoringInputDataBaseClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalMonitoringInputDataBaseClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil +} + +func unmarshalMonitoringSignalBaseClassification(rawMsg json.RawMessage) (MonitoringSignalBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MonitoringSignalBaseClassification + switch m["signalType"] { + case string(MonitoringSignalTypeCustom): + b = &CustomMonitoringSignal{} + case string(MonitoringSignalTypeDataDrift): + b = &DataDriftMonitoringSignal{} + case string(MonitoringSignalTypeDataQuality): + b = &DataQualityMonitoringSignal{} + case string(MonitoringSignalTypeFeatureAttributionDrift): + b = &FeatureAttributionDriftMonitoringSignal{} + case string(MonitoringSignalTypeGenerationSafetyQuality): + b = &GenerationSafetyQualityMonitoringSignal{} + case string(MonitoringSignalTypeGenerationTokenStatistics): + b = &GenerationTokenUsageSignal{} + case string(MonitoringSignalTypeModelPerformance): + b = &ModelPerformanceSignal{} + case string(MonitoringSignalTypePredictionDrift): + b = &PredictionDriftMonitoringSignal{} + default: + b = &MonitoringSignalBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMonitoringSignalBaseClassificationMap(rawMsg json.RawMessage) (map[string]MonitoringSignalBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]MonitoringSignalBaseClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalMonitoringSignalBaseClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil +} + func unmarshalNCrossValidationsClassification(rawMsg json.RawMessage) (NCrossValidationsClassification, error) { if rawMsg == nil { return nil, nil @@ -446,7 +991,52 @@ func unmarshalNCrossValidationsClassification(rawMsg json.RawMessage) (NCrossVal default: b = &NCrossValidations{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalNodesClassification(rawMsg json.RawMessage) (NodesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b NodesClassification + switch m["nodesValueType"] { + case string(NodesValueTypeAll): + b = &AllNodes{} + default: + b = &Nodes{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalOneLakeArtifactClassification(rawMsg json.RawMessage) (OneLakeArtifactClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b OneLakeArtifactClassification + switch m["artifactType"] { + case string(OneLakeArtifactTypeLakeHouse): + b = &LakeHouseArtifact{} + default: + b = &OneLakeArtifact{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalOnlineDeploymentPropertiesClassification(rawMsg json.RawMessage) (OnlineDeploymentPropertiesClassification, error) { @@ -466,7 +1056,10 @@ func unmarshalOnlineDeploymentPropertiesClassification(rawMsg json.RawMessage) ( default: b = &OnlineDeploymentProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalOnlineScaleSettingsClassification(rawMsg json.RawMessage) (OnlineScaleSettingsClassification, error) { @@ -486,7 +1079,142 @@ func unmarshalOnlineScaleSettingsClassification(rawMsg json.RawMessage) (OnlineS default: b = &OnlineScaleSettings{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalOutboundRuleClassification(rawMsg json.RawMessage) (OutboundRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b OutboundRuleClassification + switch m["type"] { + case string(RuleTypeFQDN): + b = &FqdnOutboundRule{} + case string(RuleTypePrivateEndpoint): + b = &PrivateEndpointOutboundRule{} + case string(RuleTypeServiceTag): + b = &ServiceTagOutboundRule{} + default: + b = &OutboundRule{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalOutboundRuleClassificationMap(rawMsg json.RawMessage) (map[string]OutboundRuleClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]OutboundRuleClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalOutboundRuleClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil +} + +func unmarshalPackageInputPathBaseClassification(rawMsg json.RawMessage) (PackageInputPathBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PackageInputPathBaseClassification + switch m["inputPathType"] { + case string(InputPathTypePathID): + b = &PackageInputPathID{} + case string(InputPathTypePathVersion): + b = &PackageInputPathVersion{} + case string(InputPathTypeURL): + b = &PackageInputPathURL{} + default: + b = &PackageInputPathBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalPendingUploadCredentialDtoClassification(rawMsg json.RawMessage) (PendingUploadCredentialDtoClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PendingUploadCredentialDtoClassification + switch m["credentialType"] { + case string(PendingUploadCredentialTypeSAS): + b = &SASCredentialDto{} + default: + b = &PendingUploadCredentialDto{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalPredictionDriftMetricThresholdBaseClassification(rawMsg json.RawMessage) (PredictionDriftMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PredictionDriftMetricThresholdBaseClassification + switch m["dataType"] { + case string(MonitoringFeatureDataTypeCategorical): + b = &CategoricalPredictionDriftMetricThreshold{} + case string(MonitoringFeatureDataTypeNumerical): + b = &NumericalPredictionDriftMetricThreshold{} + default: + b = &PredictionDriftMetricThresholdBase{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalPredictionDriftMetricThresholdBaseClassificationArray(rawMsg json.RawMessage) ([]PredictionDriftMetricThresholdBaseClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]PredictionDriftMetricThresholdBaseClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalPredictionDriftMetricThresholdBaseClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil } func unmarshalSamplingAlgorithmClassification(rawMsg json.RawMessage) (SamplingAlgorithmClassification, error) { @@ -508,7 +1236,10 @@ func unmarshalSamplingAlgorithmClassification(rawMsg json.RawMessage) (SamplingA default: b = &SamplingAlgorithm{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalScheduleActionBaseClassification(rawMsg json.RawMessage) (ScheduleActionBaseClassification, error) { @@ -523,12 +1254,19 @@ func unmarshalScheduleActionBaseClassification(rawMsg json.RawMessage) (Schedule switch m["actionType"] { case string(ScheduleActionTypeCreateJob): b = &JobScheduleAction{} + case string(ScheduleActionTypeCreateMonitor): + b = &CreateMonitorAction{} + case string(ScheduleActionTypeImportData): + b = &ImportDataAction{} case string(ScheduleActionTypeInvokeBatchEndpoint): b = &EndpointScheduleAction{} default: b = &ScheduleActionBase{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalSeasonalityClassification(rawMsg json.RawMessage) (SeasonalityClassification, error) { @@ -548,7 +1286,33 @@ func unmarshalSeasonalityClassification(rawMsg json.RawMessage) (SeasonalityClas default: b = &Seasonality{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalSparkJobEntryClassification(rawMsg json.RawMessage) (SparkJobEntryClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SparkJobEntryClassification + switch m["sparkJobEntryType"] { + case string(SparkJobEntryTypeSparkJobPythonEntry): + b = &SparkJobPythonEntry{} + case string(SparkJobEntryTypeSparkJobScalaEntry): + b = &SparkJobScalaEntry{} + default: + b = &SparkJobEntry{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTargetLagsClassification(rawMsg json.RawMessage) (TargetLagsClassification, error) { @@ -568,7 +1332,10 @@ func unmarshalTargetLagsClassification(rawMsg json.RawMessage) (TargetLagsClassi default: b = &TargetLags{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTargetRollingWindowSizeClassification(rawMsg json.RawMessage) (TargetRollingWindowSizeClassification, error) { @@ -588,7 +1355,10 @@ func unmarshalTargetRollingWindowSizeClassification(rawMsg json.RawMessage) (Tar default: b = &TargetRollingWindowSize{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTriggerBaseClassification(rawMsg json.RawMessage) (TriggerBaseClassification, error) { @@ -608,7 +1378,50 @@ func unmarshalTriggerBaseClassification(rawMsg json.RawMessage) (TriggerBaseClas default: b = &TriggerBase{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalWebhookClassification(rawMsg json.RawMessage) (WebhookClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b WebhookClassification + switch m["webhookType"] { + case string(WebhookTypeAzureDevOps): + b = &AzureDevOpsWebhook{} + default: + b = &Webhook{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalWebhookClassificationMap(rawMsg json.RawMessage) (map[string]WebhookClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]WebhookClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalWebhookClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil } func unmarshalWorkspaceConnectionPropertiesV2Classification(rawMsg json.RawMessage) (WorkspaceConnectionPropertiesV2Classification, error) { @@ -621,6 +1434,12 @@ func unmarshalWorkspaceConnectionPropertiesV2Classification(rawMsg json.RawMessa } var b WorkspaceConnectionPropertiesV2Classification switch m["authType"] { + case string(ConnectionAuthTypeAPIKey): + b = &APIKeyAuthWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeAccessKey): + b = &AccessKeyAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeCustomKeys): + b = &CustomKeysWorkspaceConnectionProperties{} case string(ConnectionAuthTypeManagedIdentity): b = &ManagedIdentityAuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypeNone): @@ -629,10 +1448,15 @@ func unmarshalWorkspaceConnectionPropertiesV2Classification(rawMsg json.RawMessa b = &PATAuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypeSAS): b = &SASAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeServicePrincipal): + b = &ServicePrincipalAuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypeUsernamePassword): b = &UsernamePasswordAuthTypeWorkspaceConnectionProperties{} default: b = &WorkspaceConnectionPropertiesV2{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go index 98fd42bb9794..dcbe55ea332d 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type PrivateEndpointConnectionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { - cl, err := arm.NewClient(moduleName+".PrivateEndpointConnectionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -44,33 +43,41 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor return client, nil } -// CreateOrUpdate - Update the state of specified private endpoint connection associated with the workspace. +// CreateOrUpdate - Called by end-users to approve or reject a PE connection. This method must validate and forward the call +// to NRP. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the workspace -// - properties - The private endpoint connection properties. +// - workspaceName - Azure Machine Learning Workspace Name +// - privateEndpointConnectionName - NRP Private Endpoint Connection Name +// - body - PrivateEndpointConnection object // - options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate // method. -func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties, options) +func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, body PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, body, options) if err != nil { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, body PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,10 +100,13 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -108,26 +118,32 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res return result, nil } -// Delete - Deletes the specified private endpoint connection associated with the workspace. +// Delete - Called by end-users to delete a PE connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the workspace +// - workspaceName - Azure Machine Learning Workspace Name +// - privateEndpointConnectionName - NRP Private Endpoint Connection Name // - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete // method. func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return PrivateEndpointConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientDeleteResponse{}, err } return PrivateEndpointConnectionsClientDeleteResponse{}, nil } @@ -156,34 +172,41 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets the specified private endpoint connection associated with the workspace. +// Get - Called by end-users to get a PE connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the workspace +// - workspaceName - Azure Machine Learning Workspace Name +// - privateEndpointConnectionName - NRP Private Endpoint Connection Name // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error + const operationName = "PrivateEndpointConnectionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -210,7 +233,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,11 +248,11 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res return result, nil } -// NewListPager - List all the private endpoint connections associated with the workspace. +// NewListPager - Called by end-users to get all PE connections. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { @@ -238,6 +261,7 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s return false }, Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateEndpointConnectionsClient.NewListPager") req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return PrivateEndpointConnectionsClientListResponse{}, err @@ -251,12 +275,17 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } // listCreateRequest creates the List request. func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -265,16 +294,12 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, errors.New("parameter workspaceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client_example_test.go deleted file mode 100644 index 78b5326d67ff..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/list.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("rg-1234", "testworkspace", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armmachinelearning.PrivateEndpointConnectionListResult{ - // Value: []*armmachinelearning.PrivateEndpointConnection{ - // { - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armmachinelearning.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmachinelearning.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armmachinelearning.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmachinelearning.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/get.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armmachinelearning.PrivateEndpointConnection{ - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armmachinelearning.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmachinelearning.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/createOrUpdate.json -func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().CreateOrUpdate(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", armmachinelearning.PrivateEndpointConnection{ - Properties: &armmachinelearning.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armmachinelearning.PrivateEndpointConnection{ - // Name: to.Ptr("{privateEndpointConnectionName}"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/privateEndpointConnections/{privateEndpointConnectionName}"), - // Properties: &armmachinelearning.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmachinelearning.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateEndpointConnection/delete.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "rg-1234", "testworkspace", "{privateEndpointConnectionName}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client.go index 1a7327c2d4b1..236f5fde6bd5 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type PrivateLinkResourcesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { - cl, err := arm.NewClient(moduleName+".PrivateLinkResourcesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -44,27 +43,39 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke return client, nil } -// List - Gets the private link resources that need to be created for a workspace. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - 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. Pre single +// connection endpoint per workspace: the Data Plane IP address, returned by DNS resolution. Other RPs, such as Azure Storage, +// have multiple - one for Blobs, other for Queues, etc. Defined in the "[NRP] +// Private Endpoint Design" doc, topic "GET API for GroupIds". // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. -// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List +// - workspaceName - Azure Machine Learning Workspace Name +// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager // method. -func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListOptions) (PrivateLinkResourcesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - if err != nil { - return PrivateLinkResourcesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return PrivateLinkResourcesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +func (client *PrivateLinkResourcesClient) NewListPager(resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListOptions) *runtime.Pager[PrivateLinkResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListResponse]{ + More: func(page PrivateLinkResourcesClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListResponse) (PrivateLinkResourcesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateLinkResourcesClient.NewListPager") + req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) } // listCreateRequest creates the List request. @@ -87,7 +98,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client_example_test.go deleted file mode 100644 index e344c27f9ec0..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,51 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/PrivateLinkResource/list.json -func ExamplePrivateLinkResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().List(ctx, "rg-1234", "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResourceListResult = armmachinelearning.PrivateLinkResourceListResult{ - // Value: []*armmachinelearning.PrivateLinkResource{ - // { - // Name: to.Ptr("amlworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/privateLinkResources/amlworkspace"), - // Properties: &armmachinelearning.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("amlworkspace"), - // RequiredMembers: []*string{ - // to.Ptr("default")}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client.go index 55119e1469d5..ec020081713b 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type QuotasClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewQuotasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotasClient, error) { - cl, err := arm.NewClient(moduleName+".QuotasClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +45,7 @@ func NewQuotasClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - Gets the currently assigned Workspace Quotas based on VMFamily. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - location - The location for which resource usage is queried. // - options - QuotasClientListOptions contains the optional parameters for the QuotasClient.NewListPager method. func (client *QuotasClient) NewListPager(location string, options *QuotasClientListOptions) *runtime.Pager[QuotasClientListResponse] { @@ -55,25 +54,20 @@ func (client *QuotasClient) NewListPager(location string, options *QuotasClientL return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *QuotasClientListResponse) (QuotasClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "QuotasClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, location, options) + }, nil) if err != nil { return QuotasClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return QuotasClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QuotasClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -93,7 +87,7 @@ func (client *QuotasClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,23 +105,30 @@ func (client *QuotasClient) listHandleResponse(resp *http.Response) (QuotasClien // Update - Update quota for each VM family in workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - location - The location for update quota is queried. // - parameters - Quota update parameters. // - options - QuotasClientUpdateOptions contains the optional parameters for the QuotasClient.Update method. func (client *QuotasClient) Update(ctx context.Context, location string, parameters QuotaUpdateParameters, options *QuotasClientUpdateOptions) (QuotasClientUpdateResponse, error) { + var err error + const operationName = "QuotasClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.updateCreateRequest(ctx, location, parameters, options) if err != nil { return QuotasClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return QuotasClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QuotasClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return QuotasClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -146,10 +147,13 @@ func (client *QuotasClient) updateCreateRequest(ctx context.Context, location st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client_example_test.go deleted file mode 100644 index cad9ba904c35..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client_example_test.go +++ /dev/null @@ -1,498 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/update.json -func ExampleQuotasClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQuotasClient().Update(ctx, "eastus", armmachinelearning.QuotaUpdateParameters{ - Value: []*armmachinelearning.QuotaBaseProperties{ - { - Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - Limit: to.Ptr[int64](100), - Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - }, - { - Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - Limit: to.Ptr[int64](200), - Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UpdateWorkspaceQuotasResult = armmachinelearning.UpdateWorkspaceQuotasResult{ - // Value: []*armmachinelearning.UpdateWorkspaceQuotas{ - // { - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](100), - // Status: to.Ptr(armmachinelearning.StatusSuccess), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](200), - // Status: to.Ptr(armmachinelearning.StatusSuccess), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Quota/list.json -func ExampleQuotasClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQuotasClient().NewListPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListWorkspaceQuotas = armmachinelearning.ListWorkspaceQuotas{ - // Value: []*armmachinelearning.ResourceQuota{ - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_D_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](48), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_D_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](12), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_D_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](12), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_D_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quota"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](12), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](12), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_Dv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_Dv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_Dv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_Dv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_FSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_FSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_FSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_FSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](12), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_NCv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_NCv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_NCv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_NCv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_NCv3_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_NCv3_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_NCv3_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_NCv3_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_ND_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_ND_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_ND_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_ND_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_NDv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_NDv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_NDv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_NDv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/quotas/Standard_NV_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/Standard_NV_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/Standard_NV_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }, - // { - // Name: &armmachinelearning.ResourceName{ - // LocalizedValue: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/quotas"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace3/quotas/Standard_NV_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.QuotaUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registries_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registries_client.go new file mode 100644 index 000000000000..94c549a4c262 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registries_client.go @@ -0,0 +1,528 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistriesClient contains the methods for the Registries group. +// Don't use this type directly, use NewRegistriesClient() instead. +type RegistriesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistriesClient creates a new instance of RegistriesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistriesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistriesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - body - Details required to create the registry. +// - options - RegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistriesClient.BeginCreateOrUpdate +// method. +func (client *RegistriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, body Registry, options *RegistriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistriesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistriesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, body Registry, options *RegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistriesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, body Registry, options *RegistriesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistriesClientBeginDeleteOptions contains the optional parameters for the RegistriesClient.BeginDelete method. +func (client *RegistriesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientBeginDeleteOptions) (*runtime.Poller[RegistriesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistriesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistriesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method. +func (client *RegistriesClient) Get(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientGetOptions) (RegistriesClientGetResponse, error) { + var err error + const operationName = "RegistriesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, options) + if err != nil { + return RegistriesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistriesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistriesClient) getHandleResponse(resp *http.Response) (RegistriesClientGetResponse, error) { + result := RegistriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Registry); err != nil { + return RegistriesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List registries +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - RegistriesClientListOptions contains the optional parameters for the RegistriesClient.NewListPager method. +func (client *RegistriesClient) NewListPager(resourceGroupName string, options *RegistriesClientListOptions) *runtime.Pager[RegistriesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistriesClientListResponse]{ + More: func(page RegistriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistriesClientListResponse) (RegistriesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistriesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return RegistriesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RegistriesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistriesClient) listHandleResponse(resp *http.Response) (RegistriesClientListResponse, error) { + result := RegistriesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RegistryTrackedResourceArmPaginatedResult); err != nil { + return RegistriesClientListResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List registries by subscription +// +// Generated from API version 2024-01-01-preview +// - options - RegistriesClientListBySubscriptionOptions contains the optional parameters for the RegistriesClient.NewListBySubscriptionPager +// method. +func (client *RegistriesClient) NewListBySubscriptionPager(options *RegistriesClientListBySubscriptionOptions) *runtime.Pager[RegistriesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistriesClientListBySubscriptionResponse]{ + More: func(page RegistriesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistriesClientListBySubscriptionResponse) (RegistriesClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistriesClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return RegistriesClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *RegistriesClient) listBySubscriptionCreateRequest(ctx context.Context, options *RegistriesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/registries" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *RegistriesClient) listBySubscriptionHandleResponse(resp *http.Response) (RegistriesClientListBySubscriptionResponse, error) { + result := RegistriesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RegistryTrackedResourceArmPaginatedResult); err != nil { + return RegistriesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginRemoveRegions - Remove regions from registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - body - Details required to create the registry. +// - options - RegistriesClientBeginRemoveRegionsOptions contains the optional parameters for the RegistriesClient.BeginRemoveRegions +// method. +func (client *RegistriesClient) BeginRemoveRegions(ctx context.Context, resourceGroupName string, registryName string, body Registry, options *RegistriesClientBeginRemoveRegionsOptions) (*runtime.Poller[RegistriesClientRemoveRegionsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.removeRegions(ctx, resourceGroupName, registryName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientRemoveRegionsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistriesClientRemoveRegionsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// RemoveRegions - Remove regions from registry +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistriesClient) removeRegions(ctx context.Context, resourceGroupName string, registryName string, body Registry, options *RegistriesClientBeginRemoveRegionsOptions) (*http.Response, error) { + var err error + const operationName = "RegistriesClient.BeginRemoveRegions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.removeRegionsCreateRequest(ctx, resourceGroupName, registryName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// removeRegionsCreateRequest creates the RemoveRegions request. +func (client *RegistriesClient) removeRegionsCreateRequest(ctx context.Context, resourceGroupName string, registryName string, body Registry, options *RegistriesClientBeginRemoveRegionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/removeRegions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// Update - Update tags +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - body - Details required to create the registry. +// - options - RegistriesClientUpdateOptions contains the optional parameters for the RegistriesClient.Update method. +func (client *RegistriesClient) Update(ctx context.Context, resourceGroupName string, registryName string, body PartialRegistryPartialTrackedResource, options *RegistriesClientUpdateOptions) (RegistriesClientUpdateResponse, error) { + var err error + const operationName = "RegistriesClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, registryName, body, options) + if err != nil { + return RegistriesClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistriesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistriesClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *RegistriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, body PartialRegistryPartialTrackedResource, options *RegistriesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *RegistriesClient) updateHandleResponse(resp *http.Response) (RegistriesClientUpdateResponse, error) { + result := RegistriesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Registry); err != nil { + return RegistriesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrycodecontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycodecontainers_client.go new file mode 100644 index 000000000000..6f7e6112c373 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycodecontainers_client.go @@ -0,0 +1,350 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistryCodeContainersClient contains the methods for the RegistryCodeContainers group. +// Don't use this type directly, use NewRegistryCodeContainersClient() instead. +type RegistryCodeContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryCodeContainersClient creates a new instance of RegistryCodeContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryCodeContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryCodeContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryCodeContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update Code container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - body - Container entity to create or update. +// - options - RegistryCodeContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryCodeContainersClient.BeginCreateOrUpdate +// method. +func (client *RegistryCodeContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, codeName string, body CodeContainer, options *RegistryCodeContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryCodeContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, codeName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryCodeContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryCodeContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update Code container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryCodeContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, codeName string, body CodeContainer, options *RegistryCodeContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryCodeContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, codeName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryCodeContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, body CodeContainer, options *RegistryCodeContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Code container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - options - RegistryCodeContainersClientBeginDeleteOptions contains the optional parameters for the RegistryCodeContainersClient.BeginDelete +// method. +func (client *RegistryCodeContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *RegistryCodeContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryCodeContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, codeName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryCodeContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryCodeContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Code container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryCodeContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *RegistryCodeContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryCodeContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, codeName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryCodeContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *RegistryCodeContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Code container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - options - RegistryCodeContainersClientGetOptions contains the optional parameters for the RegistryCodeContainersClient.Get +// method. +func (client *RegistryCodeContainersClient) Get(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *RegistryCodeContainersClientGetOptions) (RegistryCodeContainersClientGetResponse, error) { + var err error + const operationName = "RegistryCodeContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, codeName, options) + if err != nil { + return RegistryCodeContainersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryCodeContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryCodeContainersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryCodeContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *RegistryCodeContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryCodeContainersClient) getHandleResponse(resp *http.Response) (RegistryCodeContainersClientGetResponse, error) { + result := RegistryCodeContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeContainer); err != nil { + return RegistryCodeContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistryCodeContainersClientListOptions contains the optional parameters for the RegistryCodeContainersClient.NewListPager +// method. +func (client *RegistryCodeContainersClient) NewListPager(resourceGroupName string, registryName string, options *RegistryCodeContainersClientListOptions) *runtime.Pager[RegistryCodeContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryCodeContainersClientListResponse]{ + More: func(page RegistryCodeContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryCodeContainersClientListResponse) (RegistryCodeContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryCodeContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, options) + }, nil) + if err != nil { + return RegistryCodeContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryCodeContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistryCodeContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryCodeContainersClient) listHandleResponse(resp *http.Response) (RegistryCodeContainersClientListResponse, error) { + result := RegistryCodeContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeContainerResourceArmPaginatedResult); err != nil { + return RegistryCodeContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrycodeversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycodeversions_client.go new file mode 100644 index 000000000000..c73ae25c4af8 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycodeversions_client.go @@ -0,0 +1,456 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RegistryCodeVersionsClient contains the methods for the RegistryCodeVersions group. +// Don't use this type directly, use NewRegistryCodeVersionsClient() instead. +type RegistryCodeVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryCodeVersionsClient creates a new instance of RegistryCodeVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryCodeVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryCodeVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryCodeVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrGetStartPendingUpload - Generate a storage location and credential for the client to upload a code asset to. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Pending upload name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Pending upload request object +// - options - RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the RegistryCodeVersionsClient.CreateOrGetStartPendingUpload +// method. +func (client *RegistryCodeVersionsClient) CreateOrGetStartPendingUpload(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body PendingUploadRequestDto, options *RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions) (RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse, error) { + var err error + const operationName = "RegistryCodeVersionsClient.CreateOrGetStartPendingUpload" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrGetStartPendingUploadCreateRequest(ctx, resourceGroupName, registryName, codeName, version, body, options) + if err != nil { + return RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + resp, err := client.createOrGetStartPendingUploadHandleResponse(httpResp) + return resp, err +} + +// createOrGetStartPendingUploadCreateRequest creates the CreateOrGetStartPendingUpload request. +func (client *RegistryCodeVersionsClient) createOrGetStartPendingUploadCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body PendingUploadRequestDto, options *RegistryCodeVersionsClientCreateOrGetStartPendingUploadOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}/startPendingUpload" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// createOrGetStartPendingUploadHandleResponse handles the CreateOrGetStartPendingUpload response. +func (client *RegistryCodeVersionsClient) createOrGetStartPendingUploadHandleResponse(resp *http.Response) (RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse, error) { + result := RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PendingUploadResponseDto); err != nil { + return RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - version - Version identifier. +// - body - Version entity to create or update. +// - options - RegistryCodeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryCodeVersionsClient.BeginCreateOrUpdate +// method. +func (client *RegistryCodeVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body CodeVersion, options *RegistryCodeVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryCodeVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, codeName, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryCodeVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryCodeVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryCodeVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body CodeVersion, options *RegistryCodeVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryCodeVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, codeName, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryCodeVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, body CodeVersion, options *RegistryCodeVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - version - Version identifier. +// - options - RegistryCodeVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryCodeVersionsClient.BeginDelete +// method. +func (client *RegistryCodeVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *RegistryCodeVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryCodeVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, codeName, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryCodeVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryCodeVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryCodeVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *RegistryCodeVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryCodeVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, codeName, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryCodeVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *RegistryCodeVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - version - Version identifier. +// - options - RegistryCodeVersionsClientGetOptions contains the optional parameters for the RegistryCodeVersionsClient.Get +// method. +func (client *RegistryCodeVersionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *RegistryCodeVersionsClientGetOptions) (RegistryCodeVersionsClientGetResponse, error) { + var err error + const operationName = "RegistryCodeVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, codeName, version, options) + if err != nil { + return RegistryCodeVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryCodeVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryCodeVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryCodeVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, version string, options *RegistryCodeVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryCodeVersionsClient) getHandleResponse(resp *http.Response) (RegistryCodeVersionsClientGetResponse, error) { + result := RegistryCodeVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeVersion); err != nil { + return RegistryCodeVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - codeName - Container name. +// - options - RegistryCodeVersionsClientListOptions contains the optional parameters for the RegistryCodeVersionsClient.NewListPager +// method. +func (client *RegistryCodeVersionsClient) NewListPager(resourceGroupName string, registryName string, codeName string, options *RegistryCodeVersionsClientListOptions) *runtime.Pager[RegistryCodeVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryCodeVersionsClientListResponse]{ + More: func(page RegistryCodeVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryCodeVersionsClientListResponse) (RegistryCodeVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryCodeVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, codeName, options) + }, nil) + if err != nil { + return RegistryCodeVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryCodeVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, codeName string, options *RegistryCodeVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/codes/{codeName}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if codeName == "" { + return nil, errors.New("parameter codeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{codeName}", url.PathEscape(codeName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryCodeVersionsClient) listHandleResponse(resp *http.Response) (RegistryCodeVersionsClientListResponse, error) { + result := RegistryCodeVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CodeVersionResourceArmPaginatedResult); err != nil { + return RegistryCodeVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentcontainers_client.go new file mode 100644 index 000000000000..2ceb0186818c --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentcontainers_client.go @@ -0,0 +1,350 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistryComponentContainersClient contains the methods for the RegistryComponentContainers group. +// Don't use this type directly, use NewRegistryComponentContainersClient() instead. +type RegistryComponentContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryComponentContainersClient creates a new instance of RegistryComponentContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryComponentContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryComponentContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryComponentContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - body - Container entity to create or update. +// - options - RegistryComponentContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryComponentContainersClient.BeginCreateOrUpdate +// method. +func (client *RegistryComponentContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, componentName string, body ComponentContainer, options *RegistryComponentContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryComponentContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, componentName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryComponentContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryComponentContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryComponentContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, componentName string, body ComponentContainer, options *RegistryComponentContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryComponentContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, componentName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryComponentContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, body ComponentContainer, options *RegistryComponentContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - options - RegistryComponentContainersClientBeginDeleteOptions contains the optional parameters for the RegistryComponentContainersClient.BeginDelete +// method. +func (client *RegistryComponentContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *RegistryComponentContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryComponentContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, componentName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryComponentContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryComponentContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryComponentContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *RegistryComponentContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryComponentContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, componentName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryComponentContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *RegistryComponentContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - options - RegistryComponentContainersClientGetOptions contains the optional parameters for the RegistryComponentContainersClient.Get +// method. +func (client *RegistryComponentContainersClient) Get(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *RegistryComponentContainersClientGetOptions) (RegistryComponentContainersClientGetResponse, error) { + var err error + const operationName = "RegistryComponentContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, componentName, options) + if err != nil { + return RegistryComponentContainersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryComponentContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryComponentContainersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryComponentContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *RegistryComponentContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryComponentContainersClient) getHandleResponse(resp *http.Response) (RegistryComponentContainersClientGetResponse, error) { + result := RegistryComponentContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentContainer); err != nil { + return RegistryComponentContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistryComponentContainersClientListOptions contains the optional parameters for the RegistryComponentContainersClient.NewListPager +// method. +func (client *RegistryComponentContainersClient) NewListPager(resourceGroupName string, registryName string, options *RegistryComponentContainersClientListOptions) *runtime.Pager[RegistryComponentContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryComponentContainersClientListResponse]{ + More: func(page RegistryComponentContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryComponentContainersClientListResponse) (RegistryComponentContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryComponentContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, options) + }, nil) + if err != nil { + return RegistryComponentContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryComponentContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistryComponentContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryComponentContainersClient) listHandleResponse(resp *http.Response) (RegistryComponentContainersClientListResponse, error) { + result := RegistryComponentContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentContainerResourceArmPaginatedResult); err != nil { + return RegistryComponentContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentversions_client.go new file mode 100644 index 000000000000..30d18a523dde --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentversions_client.go @@ -0,0 +1,380 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RegistryComponentVersionsClient contains the methods for the RegistryComponentVersions group. +// Don't use this type directly, use NewRegistryComponentVersionsClient() instead. +type RegistryComponentVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryComponentVersionsClient creates a new instance of RegistryComponentVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryComponentVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryComponentVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryComponentVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - version - Version identifier. +// - body - Version entity to create or update. +// - options - RegistryComponentVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryComponentVersionsClient.BeginCreateOrUpdate +// method. +func (client *RegistryComponentVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, body ComponentVersion, options *RegistryComponentVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryComponentVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, componentName, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryComponentVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryComponentVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryComponentVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, body ComponentVersion, options *RegistryComponentVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryComponentVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, componentName, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryComponentVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, body ComponentVersion, options *RegistryComponentVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - version - Version identifier. +// - options - RegistryComponentVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryComponentVersionsClient.BeginDelete +// method. +func (client *RegistryComponentVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *RegistryComponentVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryComponentVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, componentName, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryComponentVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryComponentVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryComponentVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *RegistryComponentVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryComponentVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, componentName, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryComponentVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *RegistryComponentVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - version - Version identifier. +// - options - RegistryComponentVersionsClientGetOptions contains the optional parameters for the RegistryComponentVersionsClient.Get +// method. +func (client *RegistryComponentVersionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *RegistryComponentVersionsClientGetOptions) (RegistryComponentVersionsClientGetResponse, error) { + var err error + const operationName = "RegistryComponentVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, componentName, version, options) + if err != nil { + return RegistryComponentVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryComponentVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryComponentVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryComponentVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, version string, options *RegistryComponentVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryComponentVersionsClient) getHandleResponse(resp *http.Response) (RegistryComponentVersionsClientGetResponse, error) { + result := RegistryComponentVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentVersion); err != nil { + return RegistryComponentVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - componentName - Container name. +// - options - RegistryComponentVersionsClientListOptions contains the optional parameters for the RegistryComponentVersionsClient.NewListPager +// method. +func (client *RegistryComponentVersionsClient) NewListPager(resourceGroupName string, registryName string, componentName string, options *RegistryComponentVersionsClientListOptions) *runtime.Pager[RegistryComponentVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryComponentVersionsClientListResponse]{ + More: func(page RegistryComponentVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryComponentVersionsClientListResponse) (RegistryComponentVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryComponentVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, componentName, options) + }, nil) + if err != nil { + return RegistryComponentVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryComponentVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, componentName string, options *RegistryComponentVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/components/{componentName}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if componentName == "" { + return nil, errors.New("parameter componentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryComponentVersionsClient) listHandleResponse(resp *http.Response) (RegistryComponentVersionsClientListResponse, error) { + result := RegistryComponentVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ComponentVersionResourceArmPaginatedResult); err != nil { + return RegistryComponentVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrydatacontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrydatacontainers_client.go new file mode 100644 index 000000000000..4e8110cd6674 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrydatacontainers_client.go @@ -0,0 +1,353 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistryDataContainersClient contains the methods for the RegistryDataContainers group. +// Don't use this type directly, use NewRegistryDataContainersClient() instead. +type RegistryDataContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryDataContainersClient creates a new instance of RegistryDataContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryDataContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryDataContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryDataContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Container name. +// - body - Container entity to create or update. +// - options - RegistryDataContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryDataContainersClient.BeginCreateOrUpdate +// method. +func (client *RegistryDataContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, name string, body DataContainer, options *RegistryDataContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryDataContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, name, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryDataContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryDataContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryDataContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, name string, body DataContainer, options *RegistryDataContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryDataContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, name, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryDataContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, body DataContainer, options *RegistryDataContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Container name. +// - options - RegistryDataContainersClientBeginDeleteOptions contains the optional parameters for the RegistryDataContainersClient.BeginDelete +// method. +func (client *RegistryDataContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, name string, options *RegistryDataContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryDataContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, name, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryDataContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryDataContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryDataContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, name string, options *RegistryDataContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryDataContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, name, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryDataContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, options *RegistryDataContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Container name. +// - options - RegistryDataContainersClientGetOptions contains the optional parameters for the RegistryDataContainersClient.Get +// method. +func (client *RegistryDataContainersClient) Get(ctx context.Context, resourceGroupName string, registryName string, name string, options *RegistryDataContainersClientGetOptions) (RegistryDataContainersClientGetResponse, error) { + var err error + const operationName = "RegistryDataContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, name, options) + if err != nil { + return RegistryDataContainersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryDataContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryDataContainersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryDataContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, options *RegistryDataContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryDataContainersClient) getHandleResponse(resp *http.Response) (RegistryDataContainersClientGetResponse, error) { + result := RegistryDataContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataContainer); err != nil { + return RegistryDataContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List Data containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistryDataContainersClientListOptions contains the optional parameters for the RegistryDataContainersClient.NewListPager +// method. +func (client *RegistryDataContainersClient) NewListPager(resourceGroupName string, registryName string, options *RegistryDataContainersClientListOptions) *runtime.Pager[RegistryDataContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryDataContainersClientListResponse]{ + More: func(page RegistryDataContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryDataContainersClientListResponse) (RegistryDataContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryDataContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, options) + }, nil) + if err != nil { + return RegistryDataContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryDataContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistryDataContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryDataContainersClient) listHandleResponse(resp *http.Response) (RegistryDataContainersClientListResponse, error) { + result := RegistryDataContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataContainerResourceArmPaginatedResult); err != nil { + return RegistryDataContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrydatareferences_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrydatareferences_client.go new file mode 100644 index 000000000000..eb528faba264 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrydatareferences_client.go @@ -0,0 +1,123 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistryDataReferencesClient contains the methods for the RegistryDataReferences group. +// Don't use this type directly, use NewRegistryDataReferencesClient() instead. +type RegistryDataReferencesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryDataReferencesClient creates a new instance of RegistryDataReferencesClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryDataReferencesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryDataReferencesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryDataReferencesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// GetBlobReferenceSAS - Get blob reference SAS Uri value. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Data reference name. +// - version - Version identifier. +// - body - Asset id and blob uri. +// - options - RegistryDataReferencesClientGetBlobReferenceSASOptions contains the optional parameters for the RegistryDataReferencesClient.GetBlobReferenceSAS +// method. +func (client *RegistryDataReferencesClient) GetBlobReferenceSAS(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body GetBlobReferenceSASRequestDto, options *RegistryDataReferencesClientGetBlobReferenceSASOptions) (RegistryDataReferencesClientGetBlobReferenceSASResponse, error) { + var err error + const operationName = "RegistryDataReferencesClient.GetBlobReferenceSAS" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getBlobReferenceSASCreateRequest(ctx, resourceGroupName, registryName, name, version, body, options) + if err != nil { + return RegistryDataReferencesClientGetBlobReferenceSASResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryDataReferencesClientGetBlobReferenceSASResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryDataReferencesClientGetBlobReferenceSASResponse{}, err + } + resp, err := client.getBlobReferenceSASHandleResponse(httpResp) + return resp, err +} + +// getBlobReferenceSASCreateRequest creates the GetBlobReferenceSAS request. +func (client *RegistryDataReferencesClient) getBlobReferenceSASCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body GetBlobReferenceSASRequestDto, options *RegistryDataReferencesClientGetBlobReferenceSASOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/datareferences/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// getBlobReferenceSASHandleResponse handles the GetBlobReferenceSAS response. +func (client *RegistryDataReferencesClient) getBlobReferenceSASHandleResponse(resp *http.Response) (RegistryDataReferencesClientGetBlobReferenceSASResponse, error) { + result := RegistryDataReferencesClientGetBlobReferenceSASResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GetBlobReferenceSASResponseDto); err != nil { + return RegistryDataReferencesClientGetBlobReferenceSASResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrydataversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrydataversions_client.go new file mode 100644 index 000000000000..50ead8427de4 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrydataversions_client.go @@ -0,0 +1,462 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RegistryDataVersionsClient contains the methods for the RegistryDataVersions group. +// Don't use this type directly, use NewRegistryDataVersionsClient() instead. +type RegistryDataVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryDataVersionsClient creates a new instance of RegistryDataVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryDataVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryDataVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryDataVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrGetStartPendingUpload - Generate a storage location and credential for the client to upload a data asset to. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Data asset name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Pending upload request object +// - options - RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the RegistryDataVersionsClient.CreateOrGetStartPendingUpload +// method. +func (client *RegistryDataVersionsClient) CreateOrGetStartPendingUpload(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body PendingUploadRequestDto, options *RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions) (RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse, error) { + var err error + const operationName = "RegistryDataVersionsClient.CreateOrGetStartPendingUpload" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrGetStartPendingUploadCreateRequest(ctx, resourceGroupName, registryName, name, version, body, options) + if err != nil { + return RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + resp, err := client.createOrGetStartPendingUploadHandleResponse(httpResp) + return resp, err +} + +// createOrGetStartPendingUploadCreateRequest creates the CreateOrGetStartPendingUpload request. +func (client *RegistryDataVersionsClient) createOrGetStartPendingUploadCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body PendingUploadRequestDto, options *RegistryDataVersionsClientCreateOrGetStartPendingUploadOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}/startPendingUpload" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// createOrGetStartPendingUploadHandleResponse handles the CreateOrGetStartPendingUpload response. +func (client *RegistryDataVersionsClient) createOrGetStartPendingUploadHandleResponse(resp *http.Response) (RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse, error) { + result := RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PendingUploadResponseDto); err != nil { + return RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Container name. +// - version - Version identifier. +// - body - Version entity to create or update. +// - options - RegistryDataVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryDataVersionsClient.BeginCreateOrUpdate +// method. +func (client *RegistryDataVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body DataVersionBase, options *RegistryDataVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryDataVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, name, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryDataVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryDataVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryDataVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body DataVersionBase, options *RegistryDataVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryDataVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, name, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryDataVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, version string, body DataVersionBase, options *RegistryDataVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Container name. +// - version - Version identifier. +// - options - RegistryDataVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryDataVersionsClient.BeginDelete +// method. +func (client *RegistryDataVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *RegistryDataVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryDataVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, name, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryDataVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryDataVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryDataVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *RegistryDataVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryDataVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, name, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryDataVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *RegistryDataVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Container name. +// - version - Version identifier. +// - options - RegistryDataVersionsClientGetOptions contains the optional parameters for the RegistryDataVersionsClient.Get +// method. +func (client *RegistryDataVersionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *RegistryDataVersionsClientGetOptions) (RegistryDataVersionsClientGetResponse, error) { + var err error + const operationName = "RegistryDataVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, name, version, options) + if err != nil { + return RegistryDataVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryDataVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryDataVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryDataVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, version string, options *RegistryDataVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryDataVersionsClient) getHandleResponse(resp *http.Response) (RegistryDataVersionsClientGetResponse, error) { + result := RegistryDataVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataVersionBase); err != nil { + return RegistryDataVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List data versions in the data container +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - name - Data container's name +// - options - RegistryDataVersionsClientListOptions contains the optional parameters for the RegistryDataVersionsClient.NewListPager +// method. +func (client *RegistryDataVersionsClient) NewListPager(resourceGroupName string, registryName string, name string, options *RegistryDataVersionsClientListOptions) *runtime.Pager[RegistryDataVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryDataVersionsClientListResponse]{ + More: func(page RegistryDataVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryDataVersionsClientListResponse) (RegistryDataVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryDataVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, name, options) + }, nil) + if err != nil { + return RegistryDataVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryDataVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, name string, options *RegistryDataVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/data/{name}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.Tags != nil { + reqQP.Set("$tags", *options.Tags) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryDataVersionsClient) listHandleResponse(resp *http.Response) (RegistryDataVersionsClientListResponse, error) { + result := RegistryDataVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataVersionBaseResourceArmPaginatedResult); err != nil { + return RegistryDataVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentcontainers_client.go new file mode 100644 index 000000000000..3c99f8de28bb --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentcontainers_client.go @@ -0,0 +1,353 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistryEnvironmentContainersClient contains the methods for the RegistryEnvironmentContainers group. +// Don't use this type directly, use NewRegistryEnvironmentContainersClient() instead. +type RegistryEnvironmentContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryEnvironmentContainersClient creates a new instance of RegistryEnvironmentContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryEnvironmentContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryEnvironmentContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryEnvironmentContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. +// - body - Container entity to create or update. +// - options - RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryEnvironmentContainersClient.BeginCreateOrUpdate +// method. +func (client *RegistryEnvironmentContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, environmentName string, body EnvironmentContainer, options *RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryEnvironmentContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, environmentName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryEnvironmentContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryEnvironmentContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryEnvironmentContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, environmentName string, body EnvironmentContainer, options *RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryEnvironmentContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, environmentName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryEnvironmentContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, body EnvironmentContainer, options *RegistryEnvironmentContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. +// - options - RegistryEnvironmentContainersClientBeginDeleteOptions contains the optional parameters for the RegistryEnvironmentContainersClient.BeginDelete +// method. +func (client *RegistryEnvironmentContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryEnvironmentContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, environmentName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryEnvironmentContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryEnvironmentContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryEnvironmentContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryEnvironmentContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, environmentName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryEnvironmentContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. This is case-sensitive. +// - options - RegistryEnvironmentContainersClientGetOptions contains the optional parameters for the RegistryEnvironmentContainersClient.Get +// method. +func (client *RegistryEnvironmentContainersClient) Get(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentContainersClientGetOptions) (RegistryEnvironmentContainersClientGetResponse, error) { + var err error + const operationName = "RegistryEnvironmentContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, environmentName, options) + if err != nil { + return RegistryEnvironmentContainersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryEnvironmentContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryEnvironmentContainersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryEnvironmentContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryEnvironmentContainersClient) getHandleResponse(resp *http.Response) (RegistryEnvironmentContainersClientGetResponse, error) { + result := RegistryEnvironmentContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentContainer); err != nil { + return RegistryEnvironmentContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List environment containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistryEnvironmentContainersClientListOptions contains the optional parameters for the RegistryEnvironmentContainersClient.NewListPager +// method. +func (client *RegistryEnvironmentContainersClient) NewListPager(resourceGroupName string, registryName string, options *RegistryEnvironmentContainersClientListOptions) *runtime.Pager[RegistryEnvironmentContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryEnvironmentContainersClientListResponse]{ + More: func(page RegistryEnvironmentContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryEnvironmentContainersClientListResponse) (RegistryEnvironmentContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryEnvironmentContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, options) + }, nil) + if err != nil { + return RegistryEnvironmentContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryEnvironmentContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistryEnvironmentContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryEnvironmentContainersClient) listHandleResponse(resp *http.Response) (RegistryEnvironmentContainersClientListResponse, error) { + result := RegistryEnvironmentContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentContainerResourceArmPaginatedResult); err != nil { + return RegistryEnvironmentContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentversions_client.go new file mode 100644 index 000000000000..e6730a6cf481 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentversions_client.go @@ -0,0 +1,383 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RegistryEnvironmentVersionsClient contains the methods for the RegistryEnvironmentVersions group. +// Don't use this type directly, use NewRegistryEnvironmentVersionsClient() instead. +type RegistryEnvironmentVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryEnvironmentVersionsClient creates a new instance of RegistryEnvironmentVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryEnvironmentVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryEnvironmentVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryEnvironmentVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. +// - version - Version identifier. +// - body - Version entity to create or update. +// - options - RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.BeginCreateOrUpdate +// method. +func (client *RegistryEnvironmentVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, body EnvironmentVersion, options *RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryEnvironmentVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, environmentName, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryEnvironmentVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryEnvironmentVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryEnvironmentVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, body EnvironmentVersion, options *RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryEnvironmentVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, environmentName, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryEnvironmentVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, body EnvironmentVersion, options *RegistryEnvironmentVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. +// - version - Version identifier. +// - options - RegistryEnvironmentVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.BeginDelete +// method. +func (client *RegistryEnvironmentVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *RegistryEnvironmentVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryEnvironmentVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, environmentName, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryEnvironmentVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryEnvironmentVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryEnvironmentVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *RegistryEnvironmentVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryEnvironmentVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, environmentName, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryEnvironmentVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *RegistryEnvironmentVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - options - RegistryEnvironmentVersionsClientGetOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.Get +// method. +func (client *RegistryEnvironmentVersionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *RegistryEnvironmentVersionsClientGetOptions) (RegistryEnvironmentVersionsClientGetResponse, error) { + var err error + const operationName = "RegistryEnvironmentVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, environmentName, version, options) + if err != nil { + return RegistryEnvironmentVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryEnvironmentVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryEnvironmentVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryEnvironmentVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, version string, options *RegistryEnvironmentVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryEnvironmentVersionsClient) getHandleResponse(resp *http.Response) (RegistryEnvironmentVersionsClientGetResponse, error) { + result := RegistryEnvironmentVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentVersion); err != nil { + return RegistryEnvironmentVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - environmentName - Container name. This is case-sensitive. +// - options - RegistryEnvironmentVersionsClientListOptions contains the optional parameters for the RegistryEnvironmentVersionsClient.NewListPager +// method. +func (client *RegistryEnvironmentVersionsClient) NewListPager(resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentVersionsClientListOptions) *runtime.Pager[RegistryEnvironmentVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryEnvironmentVersionsClientListResponse]{ + More: func(page RegistryEnvironmentVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryEnvironmentVersionsClientListResponse) (RegistryEnvironmentVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryEnvironmentVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, environmentName, options) + }, nil) + if err != nil { + return RegistryEnvironmentVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryEnvironmentVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, environmentName string, options *RegistryEnvironmentVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/environments/{environmentName}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryEnvironmentVersionsClient) listHandleResponse(resp *http.Response) (RegistryEnvironmentVersionsClientListResponse, error) { + result := RegistryEnvironmentVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentVersionResourceArmPaginatedResult); err != nil { + return RegistryEnvironmentVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelcontainers_client.go new file mode 100644 index 000000000000..83a7ab2a2c74 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelcontainers_client.go @@ -0,0 +1,353 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// RegistryModelContainersClient contains the methods for the RegistryModelContainers group. +// Don't use this type directly, use NewRegistryModelContainersClient() instead. +type RegistryModelContainersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryModelContainersClient creates a new instance of RegistryModelContainersClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryModelContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryModelContainersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryModelContainersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update model container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. +// - body - Container entity to create or update. +// - options - RegistryModelContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryModelContainersClient.BeginCreateOrUpdate +// method. +func (client *RegistryModelContainersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, modelName string, body ModelContainer, options *RegistryModelContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryModelContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, modelName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryModelContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryModelContainersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update model container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryModelContainersClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, modelName string, body ModelContainer, options *RegistryModelContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryModelContainersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, modelName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryModelContainersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, body ModelContainer, options *RegistryModelContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. +// - options - RegistryModelContainersClientBeginDeleteOptions contains the optional parameters for the RegistryModelContainersClient.BeginDelete +// method. +func (client *RegistryModelContainersClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *RegistryModelContainersClientBeginDeleteOptions) (*runtime.Poller[RegistryModelContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, modelName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryModelContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryModelContainersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryModelContainersClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *RegistryModelContainersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryModelContainersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, modelName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryModelContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *RegistryModelContainersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get container. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. This is case-sensitive. +// - options - RegistryModelContainersClientGetOptions contains the optional parameters for the RegistryModelContainersClient.Get +// method. +func (client *RegistryModelContainersClient) Get(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *RegistryModelContainersClientGetOptions) (RegistryModelContainersClientGetResponse, error) { + var err error + const operationName = "RegistryModelContainersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, modelName, options) + if err != nil { + return RegistryModelContainersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryModelContainersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryModelContainersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryModelContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *RegistryModelContainersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryModelContainersClient) getHandleResponse(resp *http.Response) (RegistryModelContainersClientGetResponse, error) { + result := RegistryModelContainersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelContainer); err != nil { + return RegistryModelContainersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List model containers. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - options - RegistryModelContainersClientListOptions contains the optional parameters for the RegistryModelContainersClient.NewListPager +// method. +func (client *RegistryModelContainersClient) NewListPager(resourceGroupName string, registryName string, options *RegistryModelContainersClientListOptions) *runtime.Pager[RegistryModelContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryModelContainersClientListResponse]{ + More: func(page RegistryModelContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryModelContainersClientListResponse) (RegistryModelContainersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryModelContainersClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, options) + }, nil) + if err != nil { + return RegistryModelContainersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryModelContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RegistryModelContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryModelContainersClient) listHandleResponse(resp *http.Response) (RegistryModelContainersClientListResponse, error) { + result := RegistryModelContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelContainerResourceArmPaginatedResult); err != nil { + return RegistryModelContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelversions_client.go new file mode 100644 index 000000000000..ac1550f6f639 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelversions_client.go @@ -0,0 +1,562 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RegistryModelVersionsClient contains the methods for the RegistryModelVersions group. +// Don't use this type directly, use NewRegistryModelVersionsClient() instead. +type RegistryModelVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRegistryModelVersionsClient creates a new instance of RegistryModelVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRegistryModelVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistryModelVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RegistryModelVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrGetStartPendingUpload - Generate a storage location and credential for the client to upload a model asset to. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Model name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Pending upload request object +// - options - RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions contains the optional parameters for the RegistryModelVersionsClient.CreateOrGetStartPendingUpload +// method. +func (client *RegistryModelVersionsClient) CreateOrGetStartPendingUpload(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body PendingUploadRequestDto, options *RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions) (RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse, error) { + var err error + const operationName = "RegistryModelVersionsClient.CreateOrGetStartPendingUpload" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrGetStartPendingUploadCreateRequest(ctx, resourceGroupName, registryName, modelName, version, body, options) + if err != nil { + return RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + resp, err := client.createOrGetStartPendingUploadHandleResponse(httpResp) + return resp, err +} + +// createOrGetStartPendingUploadCreateRequest creates the CreateOrGetStartPendingUpload request. +func (client *RegistryModelVersionsClient) createOrGetStartPendingUploadCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body PendingUploadRequestDto, options *RegistryModelVersionsClientCreateOrGetStartPendingUploadOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/startPendingUpload" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// createOrGetStartPendingUploadHandleResponse handles the CreateOrGetStartPendingUpload response. +func (client *RegistryModelVersionsClient) createOrGetStartPendingUploadHandleResponse(resp *http.Response) (RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse, error) { + result := RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PendingUploadResponseDto); err != nil { + return RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. +// - version - Version identifier. +// - body - Version entity to create or update. +// - options - RegistryModelVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistryModelVersionsClient.BeginCreateOrUpdate +// method. +func (client *RegistryModelVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body ModelVersion, options *RegistryModelVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[RegistryModelVersionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, registryName, modelName, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryModelVersionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryModelVersionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryModelVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body ModelVersion, options *RegistryModelVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "RegistryModelVersionsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, registryName, modelName, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RegistryModelVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body ModelVersion, options *RegistryModelVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. +// - version - Version identifier. +// - options - RegistryModelVersionsClientBeginDeleteOptions contains the optional parameters for the RegistryModelVersionsClient.BeginDelete +// method. +func (client *RegistryModelVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *RegistryModelVersionsClientBeginDeleteOptions) (*runtime.Poller[RegistryModelVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, modelName, version, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryModelVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryModelVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryModelVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *RegistryModelVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "RegistryModelVersionsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, modelName, version, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RegistryModelVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *RegistryModelVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - options - RegistryModelVersionsClientGetOptions contains the optional parameters for the RegistryModelVersionsClient.Get +// method. +func (client *RegistryModelVersionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *RegistryModelVersionsClientGetOptions) (RegistryModelVersionsClientGetResponse, error) { + var err error + const operationName = "RegistryModelVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, modelName, version, options) + if err != nil { + return RegistryModelVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RegistryModelVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegistryModelVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RegistryModelVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, options *RegistryModelVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RegistryModelVersionsClient) getHandleResponse(resp *http.Response) (RegistryModelVersionsClientGetResponse, error) { + result := RegistryModelVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelVersion); err != nil { + return RegistryModelVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List versions. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. This is case-sensitive. +// - options - RegistryModelVersionsClientListOptions contains the optional parameters for the RegistryModelVersionsClient.NewListPager +// method. +func (client *RegistryModelVersionsClient) NewListPager(resourceGroupName string, registryName string, modelName string, options *RegistryModelVersionsClientListOptions) *runtime.Pager[RegistryModelVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RegistryModelVersionsClientListResponse]{ + More: func(page RegistryModelVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RegistryModelVersionsClientListResponse) (RegistryModelVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RegistryModelVersionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, registryName, modelName, options) + }, nil) + if err != nil { + return RegistryModelVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *RegistryModelVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, options *RegistryModelVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RegistryModelVersionsClient) listHandleResponse(resp *http.Response) (RegistryModelVersionsClientListResponse, error) { + result := RegistryModelVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ModelVersionResourceArmPaginatedResult); err != nil { + return RegistryModelVersionsClientListResponse{}, err + } + return result, nil +} + +// BeginPackage - Model Version Package operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - Name of Azure Machine Learning registry. This is case-insensitive +// - modelName - Container name. This is case-sensitive. +// - version - Version identifier. This is case-sensitive. +// - body - Package operation request body. +// - options - RegistryModelVersionsClientBeginPackageOptions contains the optional parameters for the RegistryModelVersionsClient.BeginPackage +// method. +func (client *RegistryModelVersionsClient) BeginPackage(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body PackageRequest, options *RegistryModelVersionsClientBeginPackageOptions) (*runtime.Poller[RegistryModelVersionsClientPackageResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.packageOperation(ctx, resourceGroupName, registryName, modelName, version, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistryModelVersionsClientPackageResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RegistryModelVersionsClientPackageResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Package - Model Version Package operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *RegistryModelVersionsClient) packageOperation(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body PackageRequest, options *RegistryModelVersionsClientBeginPackageOptions) (*http.Response, error) { + var err error + const operationName = "RegistryModelVersionsClient.BeginPackage" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.packageCreateRequest(ctx, resourceGroupName, registryName, modelName, version, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// packageCreateRequest creates the Package request. +func (client *RegistryModelVersionsClient) packageCreateRequest(ctx context.Context, resourceGroupName string, registryName string, modelName string, version string, body PackageRequest, options *RegistryModelVersionsClientBeginPackageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName}/models/{modelName}/versions/{version}/package" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if registryName == "" { + return nil, errors.New("parameter registryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) + if modelName == "" { + return nil, errors.New("parameter modelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{modelName}", url.PathEscape(modelName)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go b/sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go index 4f441de7c293..9d84f386b268 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go @@ -3,12 +3,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning +import "encoding/json" + // BatchDeploymentsClientCreateOrUpdateResponse contains the response from method BatchDeploymentsClient.BeginCreateOrUpdate. type BatchDeploymentsClientCreateOrUpdateResponse struct { BatchDeployment @@ -26,6 +27,7 @@ type BatchDeploymentsClientGetResponse struct { // BatchDeploymentsClientListResponse contains the response from method BatchDeploymentsClient.NewListPager. type BatchDeploymentsClientListResponse struct { + // A paginated list of BatchDeployment entities. BatchDeploymentTrackedResourceArmPaginatedResult } @@ -51,11 +53,13 @@ type BatchEndpointsClientGetResponse struct { // BatchEndpointsClientListKeysResponse contains the response from method BatchEndpointsClient.ListKeys. type BatchEndpointsClientListKeysResponse struct { + // Keys for endpoint authentication. EndpointAuthKeys } // BatchEndpointsClientListResponse contains the response from method BatchEndpointsClient.NewListPager. type BatchEndpointsClientListResponse struct { + // A paginated list of BatchEndpoint entities. BatchEndpointTrackedResourceArmPaginatedResult } @@ -64,8 +68,41 @@ type BatchEndpointsClientUpdateResponse struct { BatchEndpoint } +// CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate. +type CapacityReservationGroupsClientCreateOrUpdateResponse struct { + CapacityReservationGroup +} + +// CapacityReservationGroupsClientDeleteResponse contains the response from method CapacityReservationGroupsClient.Delete. +type CapacityReservationGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get. +type CapacityReservationGroupsClientGetResponse struct { + CapacityReservationGroup +} + +// CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.NewListBySubscriptionPager. +type CapacityReservationGroupsClientListBySubscriptionResponse struct { + // A paginated list of CapacityReservationGroup entities. + CapacityReservationGroupTrackedResourceArmPaginatedResult +} + +// CapacityReservationGroupsClientListResponse contains the response from method CapacityReservationGroupsClient.NewListPager. +type CapacityReservationGroupsClientListResponse struct { + // A paginated list of CapacityReservationGroup entities. + CapacityReservationGroupTrackedResourceArmPaginatedResult +} + +// CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update. +type CapacityReservationGroupsClientUpdateResponse struct { + CapacityReservationGroup +} + // CodeContainersClientCreateOrUpdateResponse contains the response from method CodeContainersClient.CreateOrUpdate. type CodeContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. CodeContainer } @@ -76,16 +113,24 @@ type CodeContainersClientDeleteResponse struct { // CodeContainersClientGetResponse contains the response from method CodeContainersClient.Get. type CodeContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. CodeContainer } // CodeContainersClientListResponse contains the response from method CodeContainersClient.NewListPager. type CodeContainersClientListResponse struct { + // A paginated list of CodeContainer entities. CodeContainerResourceArmPaginatedResult } +// CodeVersionsClientCreateOrGetStartPendingUploadResponse contains the response from method CodeVersionsClient.CreateOrGetStartPendingUpload. +type CodeVersionsClientCreateOrGetStartPendingUploadResponse struct { + PendingUploadResponseDto +} + // CodeVersionsClientCreateOrUpdateResponse contains the response from method CodeVersionsClient.CreateOrUpdate. type CodeVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. CodeVersion } @@ -96,16 +141,24 @@ type CodeVersionsClientDeleteResponse struct { // CodeVersionsClientGetResponse contains the response from method CodeVersionsClient.Get. type CodeVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. CodeVersion } // CodeVersionsClientListResponse contains the response from method CodeVersionsClient.NewListPager. type CodeVersionsClientListResponse struct { + // A paginated list of CodeVersion entities. CodeVersionResourceArmPaginatedResult } +// CodeVersionsClientPublishResponse contains the response from method CodeVersionsClient.BeginPublish. +type CodeVersionsClientPublishResponse struct { + // placeholder for future response values +} + // ComponentContainersClientCreateOrUpdateResponse contains the response from method ComponentContainersClient.CreateOrUpdate. type ComponentContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. ComponentContainer } @@ -116,16 +169,19 @@ type ComponentContainersClientDeleteResponse struct { // ComponentContainersClientGetResponse contains the response from method ComponentContainersClient.Get. type ComponentContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. ComponentContainer } // ComponentContainersClientListResponse contains the response from method ComponentContainersClient.NewListPager. type ComponentContainersClientListResponse struct { + // A paginated list of ComponentContainer entities. ComponentContainerResourceArmPaginatedResult } // ComponentVersionsClientCreateOrUpdateResponse contains the response from method ComponentVersionsClient.CreateOrUpdate. type ComponentVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. ComponentVersion } @@ -136,16 +192,24 @@ type ComponentVersionsClientDeleteResponse struct { // ComponentVersionsClientGetResponse contains the response from method ComponentVersionsClient.Get. type ComponentVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. ComponentVersion } // ComponentVersionsClientListResponse contains the response from method ComponentVersionsClient.NewListPager. type ComponentVersionsClientListResponse struct { + // A paginated list of ComponentVersion entities. ComponentVersionResourceArmPaginatedResult } +// ComponentVersionsClientPublishResponse contains the response from method ComponentVersionsClient.BeginPublish. +type ComponentVersionsClientPublishResponse struct { + // placeholder for future response values +} + // ComputeClientCreateOrUpdateResponse contains the response from method ComputeClient.BeginCreateOrUpdate. type ComputeClientCreateOrUpdateResponse struct { + // Machine Learning compute object wrapped into ARM resource envelope. ComputeResource } @@ -154,13 +218,21 @@ type ComputeClientDeleteResponse struct { // placeholder for future response values } +// ComputeClientGetAllowedResizeSizesResponse contains the response from method ComputeClient.GetAllowedResizeSizes. +type ComputeClientGetAllowedResizeSizesResponse struct { + // The List Virtual Machine size operation response. + VirtualMachineSizeListResult +} + // ComputeClientGetResponse contains the response from method ComputeClient.Get. type ComputeClientGetResponse struct { + // Machine Learning compute object wrapped into ARM resource envelope. ComputeResource } // ComputeClientListKeysResponse contains the response from method ComputeClient.ListKeys. type ComputeClientListKeysResponse struct { + // Secrets related to a Machine Learning compute. Might differ for every type of compute. ComputeSecretsClassification } @@ -176,14 +248,21 @@ func (c *ComputeClientListKeysResponse) UnmarshalJSON(data []byte) error { // ComputeClientListNodesResponse contains the response from method ComputeClient.NewListNodesPager. type ComputeClientListNodesResponse struct { + // Result of AmlCompute Nodes AmlComputeNodesInformation } // ComputeClientListResponse contains the response from method ComputeClient.NewListPager. type ComputeClientListResponse struct { + // Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. PaginatedComputeResourcesList } +// ComputeClientResizeResponse contains the response from method ComputeClient.BeginResize. +type ComputeClientResizeResponse struct { + // placeholder for future response values +} + // ComputeClientRestartResponse contains the response from method ComputeClient.BeginRestart. type ComputeClientRestartResponse struct { // placeholder for future response values @@ -199,13 +278,25 @@ type ComputeClientStopResponse struct { // placeholder for future response values } +// ComputeClientUpdateCustomServicesResponse contains the response from method ComputeClient.UpdateCustomServices. +type ComputeClientUpdateCustomServicesResponse struct { + // placeholder for future response values +} + +// ComputeClientUpdateIdleShutdownSettingResponse contains the response from method ComputeClient.UpdateIdleShutdownSetting. +type ComputeClientUpdateIdleShutdownSettingResponse struct { + // placeholder for future response values +} + // ComputeClientUpdateResponse contains the response from method ComputeClient.BeginUpdate. type ComputeClientUpdateResponse struct { + // Machine Learning compute object wrapped into ARM resource envelope. ComputeResource } // DataContainersClientCreateOrUpdateResponse contains the response from method DataContainersClient.CreateOrUpdate. type DataContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. DataContainer } @@ -216,16 +307,19 @@ type DataContainersClientDeleteResponse struct { // DataContainersClientGetResponse contains the response from method DataContainersClient.Get. type DataContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. DataContainer } // DataContainersClientListResponse contains the response from method DataContainersClient.NewListPager. type DataContainersClientListResponse struct { + // A paginated list of DataContainer entities. DataContainerResourceArmPaginatedResult } // DataVersionsClientCreateOrUpdateResponse contains the response from method DataVersionsClient.CreateOrUpdate. type DataVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. DataVersionBase } @@ -236,16 +330,24 @@ type DataVersionsClientDeleteResponse struct { // DataVersionsClientGetResponse contains the response from method DataVersionsClient.Get. type DataVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. DataVersionBase } // DataVersionsClientListResponse contains the response from method DataVersionsClient.NewListPager. type DataVersionsClientListResponse struct { + // A paginated list of DataVersionBase entities. DataVersionBaseResourceArmPaginatedResult } +// DataVersionsClientPublishResponse contains the response from method DataVersionsClient.BeginPublish. +type DataVersionsClientPublishResponse struct { + // placeholder for future response values +} + // DatastoresClientCreateOrUpdateResponse contains the response from method DatastoresClient.CreateOrUpdate. type DatastoresClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. Datastore } @@ -256,16 +358,19 @@ type DatastoresClientDeleteResponse struct { // DatastoresClientGetResponse contains the response from method DatastoresClient.Get. type DatastoresClientGetResponse struct { + // Azure Resource Manager resource envelope. Datastore } // DatastoresClientListResponse contains the response from method DatastoresClient.NewListPager. type DatastoresClientListResponse struct { + // A paginated list of Datastore entities. DatastoreResourceArmPaginatedResult } // DatastoresClientListSecretsResponse contains the response from method DatastoresClient.ListSecrets. type DatastoresClientListSecretsResponse struct { + // Base definition for datastore secrets. DatastoreSecretsClassification } @@ -281,6 +386,7 @@ func (d *DatastoresClientListSecretsResponse) UnmarshalJSON(data []byte) error { // EnvironmentContainersClientCreateOrUpdateResponse contains the response from method EnvironmentContainersClient.CreateOrUpdate. type EnvironmentContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. EnvironmentContainer } @@ -291,16 +397,19 @@ type EnvironmentContainersClientDeleteResponse struct { // EnvironmentContainersClientGetResponse contains the response from method EnvironmentContainersClient.Get. type EnvironmentContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. EnvironmentContainer } // EnvironmentContainersClientListResponse contains the response from method EnvironmentContainersClient.NewListPager. type EnvironmentContainersClientListResponse struct { + // A paginated list of EnvironmentContainer entities. EnvironmentContainerResourceArmPaginatedResult } // EnvironmentVersionsClientCreateOrUpdateResponse contains the response from method EnvironmentVersionsClient.CreateOrUpdate. type EnvironmentVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. EnvironmentVersion } @@ -311,14 +420,231 @@ type EnvironmentVersionsClientDeleteResponse struct { // EnvironmentVersionsClientGetResponse contains the response from method EnvironmentVersionsClient.Get. type EnvironmentVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. EnvironmentVersion } // EnvironmentVersionsClientListResponse contains the response from method EnvironmentVersionsClient.NewListPager. type EnvironmentVersionsClientListResponse struct { + // A paginated list of EnvironmentVersion entities. EnvironmentVersionResourceArmPaginatedResult } +// EnvironmentVersionsClientPublishResponse contains the response from method EnvironmentVersionsClient.BeginPublish. +type EnvironmentVersionsClientPublishResponse struct { + // placeholder for future response values +} + +// FeaturesClientGetResponse contains the response from method FeaturesClient.Get. +type FeaturesClientGetResponse struct { + // Azure Resource Manager resource envelope. + Feature +} + +// FeaturesClientListResponse contains the response from method FeaturesClient.NewListPager. +type FeaturesClientListResponse struct { + // A paginated list of Feature entities. + FeatureResourceArmPaginatedResult +} + +// FeaturesetContainersClientCreateOrUpdateResponse contains the response from method FeaturesetContainersClient.BeginCreateOrUpdate. +type FeaturesetContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + FeaturesetContainer +} + +// FeaturesetContainersClientDeleteResponse contains the response from method FeaturesetContainersClient.BeginDelete. +type FeaturesetContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// FeaturesetContainersClientGetEntityResponse contains the response from method FeaturesetContainersClient.GetEntity. +type FeaturesetContainersClientGetEntityResponse struct { + // Azure Resource Manager resource envelope. + FeaturesetContainer +} + +// FeaturesetContainersClientListResponse contains the response from method FeaturesetContainersClient.NewListPager. +type FeaturesetContainersClientListResponse struct { + // A paginated list of FeaturesetContainer entities. + FeaturesetContainerResourceArmPaginatedResult +} + +// FeaturesetVersionsClientBackfillResponse contains the response from method FeaturesetVersionsClient.BeginBackfill. +type FeaturesetVersionsClientBackfillResponse struct { + // Response payload for creating a backfill request for a given feature set version + FeaturesetVersionBackfillResponse +} + +// FeaturesetVersionsClientCreateOrUpdateResponse contains the response from method FeaturesetVersionsClient.BeginCreateOrUpdate. +type FeaturesetVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + FeaturesetVersion +} + +// FeaturesetVersionsClientDeleteResponse contains the response from method FeaturesetVersionsClient.BeginDelete. +type FeaturesetVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// FeaturesetVersionsClientGetResponse contains the response from method FeaturesetVersionsClient.Get. +type FeaturesetVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + FeaturesetVersion +} + +// FeaturesetVersionsClientListResponse contains the response from method FeaturesetVersionsClient.NewListPager. +type FeaturesetVersionsClientListResponse struct { + // A paginated list of FeaturesetVersion entities. + FeaturesetVersionResourceArmPaginatedResult +} + +// FeaturestoreEntityContainersClientCreateOrUpdateResponse contains the response from method FeaturestoreEntityContainersClient.BeginCreateOrUpdate. +type FeaturestoreEntityContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + FeaturestoreEntityContainer +} + +// FeaturestoreEntityContainersClientDeleteResponse contains the response from method FeaturestoreEntityContainersClient.BeginDelete. +type FeaturestoreEntityContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// FeaturestoreEntityContainersClientGetEntityResponse contains the response from method FeaturestoreEntityContainersClient.GetEntity. +type FeaturestoreEntityContainersClientGetEntityResponse struct { + // Azure Resource Manager resource envelope. + FeaturestoreEntityContainer +} + +// FeaturestoreEntityContainersClientListResponse contains the response from method FeaturestoreEntityContainersClient.NewListPager. +type FeaturestoreEntityContainersClientListResponse struct { + // A paginated list of FeaturestoreEntityContainer entities. + FeaturestoreEntityContainerResourceArmPaginatedResult +} + +// FeaturestoreEntityVersionsClientCreateOrUpdateResponse contains the response from method FeaturestoreEntityVersionsClient.BeginCreateOrUpdate. +type FeaturestoreEntityVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + FeaturestoreEntityVersion +} + +// FeaturestoreEntityVersionsClientDeleteResponse contains the response from method FeaturestoreEntityVersionsClient.BeginDelete. +type FeaturestoreEntityVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// FeaturestoreEntityVersionsClientGetResponse contains the response from method FeaturestoreEntityVersionsClient.Get. +type FeaturestoreEntityVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + FeaturestoreEntityVersion +} + +// FeaturestoreEntityVersionsClientListResponse contains the response from method FeaturestoreEntityVersionsClient.NewListPager. +type FeaturestoreEntityVersionsClientListResponse struct { + // A paginated list of FeaturestoreEntityVersion entities. + FeaturestoreEntityVersionResourceArmPaginatedResult +} + +// InferenceEndpointsClientCreateOrUpdateResponse contains the response from method InferenceEndpointsClient.BeginCreateOrUpdate. +type InferenceEndpointsClientCreateOrUpdateResponse struct { + InferenceEndpoint +} + +// InferenceEndpointsClientDeleteResponse contains the response from method InferenceEndpointsClient.BeginDelete. +type InferenceEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// InferenceEndpointsClientGetResponse contains the response from method InferenceEndpointsClient.Get. +type InferenceEndpointsClientGetResponse struct { + InferenceEndpoint +} + +// InferenceEndpointsClientListResponse contains the response from method InferenceEndpointsClient.NewListPager. +type InferenceEndpointsClientListResponse struct { + // A paginated list of InferenceEndpoint entities. + InferenceEndpointTrackedResourceArmPaginatedResult +} + +// InferenceEndpointsClientUpdateResponse contains the response from method InferenceEndpointsClient.BeginUpdate. +type InferenceEndpointsClientUpdateResponse struct { + InferenceEndpoint +} + +// InferenceGroupsClientCreateOrUpdateResponse contains the response from method InferenceGroupsClient.BeginCreateOrUpdate. +type InferenceGroupsClientCreateOrUpdateResponse struct { + InferenceGroup +} + +// InferenceGroupsClientDeleteResponse contains the response from method InferenceGroupsClient.BeginDelete. +type InferenceGroupsClientDeleteResponse struct { + // placeholder for future response values +} + +// InferenceGroupsClientGetResponse contains the response from method InferenceGroupsClient.Get. +type InferenceGroupsClientGetResponse struct { + InferenceGroup +} + +// InferenceGroupsClientGetStatusResponse contains the response from method InferenceGroupsClient.GetStatus. +type InferenceGroupsClientGetStatusResponse struct { + GroupStatus +} + +// InferenceGroupsClientListResponse contains the response from method InferenceGroupsClient.NewListPager. +type InferenceGroupsClientListResponse struct { + // A paginated list of InferenceGroup entities. + InferenceGroupTrackedResourceArmPaginatedResult +} + +// InferenceGroupsClientListSKUsResponse contains the response from method InferenceGroupsClient.NewListSKUsPager. +type InferenceGroupsClientListSKUsResponse struct { + // A paginated list of SkuResource entities. + SKUResourceArmPaginatedResult +} + +// InferenceGroupsClientUpdateResponse contains the response from method InferenceGroupsClient.BeginUpdate. +type InferenceGroupsClientUpdateResponse struct { + InferenceGroup +} + +// InferencePoolsClientCreateOrUpdateResponse contains the response from method InferencePoolsClient.BeginCreateOrUpdate. +type InferencePoolsClientCreateOrUpdateResponse struct { + InferencePool +} + +// InferencePoolsClientDeleteResponse contains the response from method InferencePoolsClient.BeginDelete. +type InferencePoolsClientDeleteResponse struct { + // placeholder for future response values +} + +// InferencePoolsClientGetResponse contains the response from method InferencePoolsClient.Get. +type InferencePoolsClientGetResponse struct { + InferencePool +} + +// InferencePoolsClientGetStatusResponse contains the response from method InferencePoolsClient.GetStatus. +type InferencePoolsClientGetStatusResponse struct { + PoolStatus +} + +// InferencePoolsClientListResponse contains the response from method InferencePoolsClient.NewListPager. +type InferencePoolsClientListResponse struct { + // A paginated list of InferencePool entities. + InferencePoolTrackedResourceArmPaginatedResult +} + +// InferencePoolsClientListSKUsResponse contains the response from method InferencePoolsClient.NewListSKUsPager. +type InferencePoolsClientListSKUsResponse struct { + // A paginated list of SkuResource entities. + SKUResourceArmPaginatedResult +} + +// InferencePoolsClientUpdateResponse contains the response from method InferencePoolsClient.BeginUpdate. +type InferencePoolsClientUpdateResponse struct { + InferencePool +} + // JobsClientCancelResponse contains the response from method JobsClient.BeginCancel. type JobsClientCancelResponse struct { // placeholder for future response values @@ -326,6 +652,7 @@ type JobsClientCancelResponse struct { // JobsClientCreateOrUpdateResponse contains the response from method JobsClient.CreateOrUpdate. type JobsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. JobBase } @@ -336,16 +663,107 @@ type JobsClientDeleteResponse struct { // JobsClientGetResponse contains the response from method JobsClient.Get. type JobsClientGetResponse struct { + // Azure Resource Manager resource envelope. JobBase } // JobsClientListResponse contains the response from method JobsClient.NewListPager. type JobsClientListResponse struct { + // A paginated list of JobBase entities. JobBaseResourceArmPaginatedResult } +// JobsClientUpdateResponse contains the response from method JobsClient.Update. +type JobsClientUpdateResponse struct { + // Azure Resource Manager resource envelope. + JobBase +} + +// LabelingJobsClientCreateOrUpdateResponse contains the response from method LabelingJobsClient.BeginCreateOrUpdate. +type LabelingJobsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + LabelingJob +} + +// LabelingJobsClientDeleteResponse contains the response from method LabelingJobsClient.Delete. +type LabelingJobsClientDeleteResponse struct { + // placeholder for future response values +} + +// LabelingJobsClientExportLabelsResponse contains the response from method LabelingJobsClient.BeginExportLabels. +type LabelingJobsClientExportLabelsResponse struct { + ExportSummaryClassification +} + +// MarshalJSON implements the json.Marshaller interface for type LabelingJobsClientExportLabelsResponse. +func (l LabelingJobsClientExportLabelsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(l.ExportSummaryClassification) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelingJobsClientExportLabelsResponse. +func (l *LabelingJobsClientExportLabelsResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalExportSummaryClassification(data) + if err != nil { + return err + } + l.ExportSummaryClassification = res + return nil +} + +// LabelingJobsClientGetResponse contains the response from method LabelingJobsClient.Get. +type LabelingJobsClientGetResponse struct { + // Azure Resource Manager resource envelope. + LabelingJob +} + +// LabelingJobsClientListResponse contains the response from method LabelingJobsClient.NewListPager. +type LabelingJobsClientListResponse struct { + // A paginated list of LabelingJob entities. + LabelingJobResourceArmPaginatedResult +} + +// LabelingJobsClientPauseResponse contains the response from method LabelingJobsClient.Pause. +type LabelingJobsClientPauseResponse struct { + // Labeling job definition + LabelingJobProperties +} + +// LabelingJobsClientResumeResponse contains the response from method LabelingJobsClient.BeginResume. +type LabelingJobsClientResumeResponse struct { + // Labeling job definition + LabelingJobProperties +} + +// ManagedNetworkProvisionsClientProvisionManagedNetworkResponse contains the response from method ManagedNetworkProvisionsClient.BeginProvisionManagedNetwork. +type ManagedNetworkProvisionsClientProvisionManagedNetworkResponse struct { + // Status of the Provisioning for the managed network of a machine learning workspace. + ManagedNetworkProvisionStatus +} + +// ManagedNetworkSettingsRuleClientCreateOrUpdateResponse contains the response from method ManagedNetworkSettingsRuleClient.BeginCreateOrUpdate. +type ManagedNetworkSettingsRuleClientCreateOrUpdateResponse struct { + OutboundRuleBasicResource +} + +// ManagedNetworkSettingsRuleClientDeleteResponse contains the response from method ManagedNetworkSettingsRuleClient.BeginDelete. +type ManagedNetworkSettingsRuleClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedNetworkSettingsRuleClientGetResponse contains the response from method ManagedNetworkSettingsRuleClient.Get. +type ManagedNetworkSettingsRuleClientGetResponse struct { + OutboundRuleBasicResource +} + +// ManagedNetworkSettingsRuleClientListResponse contains the response from method ManagedNetworkSettingsRuleClient.NewListPager. +type ManagedNetworkSettingsRuleClientListResponse struct { + // List of outbound rules for the managed network of a machine learning workspace. + OutboundRuleListResult +} + // ModelContainersClientCreateOrUpdateResponse contains the response from method ModelContainersClient.CreateOrUpdate. type ModelContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. ModelContainer } @@ -356,16 +774,19 @@ type ModelContainersClientDeleteResponse struct { // ModelContainersClientGetResponse contains the response from method ModelContainersClient.Get. type ModelContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. ModelContainer } // ModelContainersClientListResponse contains the response from method ModelContainersClient.NewListPager. type ModelContainersClientListResponse struct { + // A paginated list of ModelContainer entities. ModelContainerResourceArmPaginatedResult } // ModelVersionsClientCreateOrUpdateResponse contains the response from method ModelVersionsClient.CreateOrUpdate. type ModelVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. ModelVersion } @@ -376,14 +797,27 @@ type ModelVersionsClientDeleteResponse struct { // ModelVersionsClientGetResponse contains the response from method ModelVersionsClient.Get. type ModelVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. ModelVersion } // ModelVersionsClientListResponse contains the response from method ModelVersionsClient.NewListPager. type ModelVersionsClientListResponse struct { + // A paginated list of ModelVersion entities. ModelVersionResourceArmPaginatedResult } +// ModelVersionsClientPackageResponse contains the response from method ModelVersionsClient.BeginPackage. +type ModelVersionsClientPackageResponse struct { + // Package response returned after async package operation completes successfully. + PackageResponse +} + +// ModelVersionsClientPublishResponse contains the response from method ModelVersionsClient.BeginPublish. +type ModelVersionsClientPublishResponse struct { + // placeholder for future response values +} + // OnlineDeploymentsClientCreateOrUpdateResponse contains the response from method OnlineDeploymentsClient.BeginCreateOrUpdate. type OnlineDeploymentsClientCreateOrUpdateResponse struct { OnlineDeployment @@ -406,11 +840,13 @@ type OnlineDeploymentsClientGetResponse struct { // OnlineDeploymentsClientListResponse contains the response from method OnlineDeploymentsClient.NewListPager. type OnlineDeploymentsClientListResponse struct { + // A paginated list of OnlineDeployment entities. OnlineDeploymentTrackedResourceArmPaginatedResult } // OnlineDeploymentsClientListSKUsResponse contains the response from method OnlineDeploymentsClient.NewListSKUsPager. type OnlineDeploymentsClientListSKUsResponse struct { + // A paginated list of SkuResource entities. SKUResourceArmPaginatedResult } @@ -436,16 +872,19 @@ type OnlineEndpointsClientGetResponse struct { // OnlineEndpointsClientGetTokenResponse contains the response from method OnlineEndpointsClient.GetToken. type OnlineEndpointsClientGetTokenResponse struct { + // Service Token EndpointAuthToken } // OnlineEndpointsClientListKeysResponse contains the response from method OnlineEndpointsClient.ListKeys. type OnlineEndpointsClientListKeysResponse struct { + // Keys for endpoint authentication. EndpointAuthKeys } // OnlineEndpointsClientListResponse contains the response from method OnlineEndpointsClient.NewListPager. type OnlineEndpointsClientListResponse struct { + // A paginated list of OnlineEndpoint entities. OnlineEndpointTrackedResourceArmPaginatedResult } @@ -461,11 +900,13 @@ type OnlineEndpointsClientUpdateResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - AmlOperationListResult + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } @@ -476,31 +917,331 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } // PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. type PrivateEndpointConnectionsClientListResponse struct { + // List of private endpoint connection associated with the specified workspace PrivateEndpointConnectionListResult } -// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. +// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.NewListPager. type PrivateLinkResourcesClientListResponse struct { + // A list of private link resources PrivateLinkResourceListResult } // QuotasClientListResponse contains the response from method QuotasClient.NewListPager. type QuotasClientListResponse struct { + // The List WorkspaceQuotasByVMFamily operation response. ListWorkspaceQuotas } // QuotasClientUpdateResponse contains the response from method QuotasClient.Update. type QuotasClientUpdateResponse struct { + // The result of update workspace quota. UpdateWorkspaceQuotasResult } +// RegistriesClientCreateOrUpdateResponse contains the response from method RegistriesClient.BeginCreateOrUpdate. +type RegistriesClientCreateOrUpdateResponse struct { + Registry +} + +// RegistriesClientDeleteResponse contains the response from method RegistriesClient.BeginDelete. +type RegistriesClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistriesClientGetResponse contains the response from method RegistriesClient.Get. +type RegistriesClientGetResponse struct { + Registry +} + +// RegistriesClientListBySubscriptionResponse contains the response from method RegistriesClient.NewListBySubscriptionPager. +type RegistriesClientListBySubscriptionResponse struct { + // A paginated list of Registry entities. + RegistryTrackedResourceArmPaginatedResult +} + +// RegistriesClientListResponse contains the response from method RegistriesClient.NewListPager. +type RegistriesClientListResponse struct { + // A paginated list of Registry entities. + RegistryTrackedResourceArmPaginatedResult +} + +// RegistriesClientRemoveRegionsResponse contains the response from method RegistriesClient.BeginRemoveRegions. +type RegistriesClientRemoveRegionsResponse struct { + Registry +} + +// RegistriesClientUpdateResponse contains the response from method RegistriesClient.Update. +type RegistriesClientUpdateResponse struct { + Registry +} + +// RegistryCodeContainersClientCreateOrUpdateResponse contains the response from method RegistryCodeContainersClient.BeginCreateOrUpdate. +type RegistryCodeContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + CodeContainer +} + +// RegistryCodeContainersClientDeleteResponse contains the response from method RegistryCodeContainersClient.BeginDelete. +type RegistryCodeContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryCodeContainersClientGetResponse contains the response from method RegistryCodeContainersClient.Get. +type RegistryCodeContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. + CodeContainer +} + +// RegistryCodeContainersClientListResponse contains the response from method RegistryCodeContainersClient.NewListPager. +type RegistryCodeContainersClientListResponse struct { + // A paginated list of CodeContainer entities. + CodeContainerResourceArmPaginatedResult +} + +// RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse contains the response from method RegistryCodeVersionsClient.CreateOrGetStartPendingUpload. +type RegistryCodeVersionsClientCreateOrGetStartPendingUploadResponse struct { + PendingUploadResponseDto +} + +// RegistryCodeVersionsClientCreateOrUpdateResponse contains the response from method RegistryCodeVersionsClient.BeginCreateOrUpdate. +type RegistryCodeVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + CodeVersion +} + +// RegistryCodeVersionsClientDeleteResponse contains the response from method RegistryCodeVersionsClient.BeginDelete. +type RegistryCodeVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryCodeVersionsClientGetResponse contains the response from method RegistryCodeVersionsClient.Get. +type RegistryCodeVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + CodeVersion +} + +// RegistryCodeVersionsClientListResponse contains the response from method RegistryCodeVersionsClient.NewListPager. +type RegistryCodeVersionsClientListResponse struct { + // A paginated list of CodeVersion entities. + CodeVersionResourceArmPaginatedResult +} + +// RegistryComponentContainersClientCreateOrUpdateResponse contains the response from method RegistryComponentContainersClient.BeginCreateOrUpdate. +type RegistryComponentContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + ComponentContainer +} + +// RegistryComponentContainersClientDeleteResponse contains the response from method RegistryComponentContainersClient.BeginDelete. +type RegistryComponentContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryComponentContainersClientGetResponse contains the response from method RegistryComponentContainersClient.Get. +type RegistryComponentContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. + ComponentContainer +} + +// RegistryComponentContainersClientListResponse contains the response from method RegistryComponentContainersClient.NewListPager. +type RegistryComponentContainersClientListResponse struct { + // A paginated list of ComponentContainer entities. + ComponentContainerResourceArmPaginatedResult +} + +// RegistryComponentVersionsClientCreateOrUpdateResponse contains the response from method RegistryComponentVersionsClient.BeginCreateOrUpdate. +type RegistryComponentVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + ComponentVersion +} + +// RegistryComponentVersionsClientDeleteResponse contains the response from method RegistryComponentVersionsClient.BeginDelete. +type RegistryComponentVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryComponentVersionsClientGetResponse contains the response from method RegistryComponentVersionsClient.Get. +type RegistryComponentVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + ComponentVersion +} + +// RegistryComponentVersionsClientListResponse contains the response from method RegistryComponentVersionsClient.NewListPager. +type RegistryComponentVersionsClientListResponse struct { + // A paginated list of ComponentVersion entities. + ComponentVersionResourceArmPaginatedResult +} + +// RegistryDataContainersClientCreateOrUpdateResponse contains the response from method RegistryDataContainersClient.BeginCreateOrUpdate. +type RegistryDataContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + DataContainer +} + +// RegistryDataContainersClientDeleteResponse contains the response from method RegistryDataContainersClient.BeginDelete. +type RegistryDataContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryDataContainersClientGetResponse contains the response from method RegistryDataContainersClient.Get. +type RegistryDataContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. + DataContainer +} + +// RegistryDataContainersClientListResponse contains the response from method RegistryDataContainersClient.NewListPager. +type RegistryDataContainersClientListResponse struct { + // A paginated list of DataContainer entities. + DataContainerResourceArmPaginatedResult +} + +// RegistryDataReferencesClientGetBlobReferenceSASResponse contains the response from method RegistryDataReferencesClient.GetBlobReferenceSAS. +type RegistryDataReferencesClientGetBlobReferenceSASResponse struct { + // BlobReferenceSASResponse for getBlobReferenceSAS API + GetBlobReferenceSASResponseDto +} + +// RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse contains the response from method RegistryDataVersionsClient.CreateOrGetStartPendingUpload. +type RegistryDataVersionsClientCreateOrGetStartPendingUploadResponse struct { + PendingUploadResponseDto +} + +// RegistryDataVersionsClientCreateOrUpdateResponse contains the response from method RegistryDataVersionsClient.BeginCreateOrUpdate. +type RegistryDataVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + DataVersionBase +} + +// RegistryDataVersionsClientDeleteResponse contains the response from method RegistryDataVersionsClient.BeginDelete. +type RegistryDataVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryDataVersionsClientGetResponse contains the response from method RegistryDataVersionsClient.Get. +type RegistryDataVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + DataVersionBase +} + +// RegistryDataVersionsClientListResponse contains the response from method RegistryDataVersionsClient.NewListPager. +type RegistryDataVersionsClientListResponse struct { + // A paginated list of DataVersionBase entities. + DataVersionBaseResourceArmPaginatedResult +} + +// RegistryEnvironmentContainersClientCreateOrUpdateResponse contains the response from method RegistryEnvironmentContainersClient.BeginCreateOrUpdate. +type RegistryEnvironmentContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + EnvironmentContainer +} + +// RegistryEnvironmentContainersClientDeleteResponse contains the response from method RegistryEnvironmentContainersClient.BeginDelete. +type RegistryEnvironmentContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryEnvironmentContainersClientGetResponse contains the response from method RegistryEnvironmentContainersClient.Get. +type RegistryEnvironmentContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. + EnvironmentContainer +} + +// RegistryEnvironmentContainersClientListResponse contains the response from method RegistryEnvironmentContainersClient.NewListPager. +type RegistryEnvironmentContainersClientListResponse struct { + // A paginated list of EnvironmentContainer entities. + EnvironmentContainerResourceArmPaginatedResult +} + +// RegistryEnvironmentVersionsClientCreateOrUpdateResponse contains the response from method RegistryEnvironmentVersionsClient.BeginCreateOrUpdate. +type RegistryEnvironmentVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + EnvironmentVersion +} + +// RegistryEnvironmentVersionsClientDeleteResponse contains the response from method RegistryEnvironmentVersionsClient.BeginDelete. +type RegistryEnvironmentVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryEnvironmentVersionsClientGetResponse contains the response from method RegistryEnvironmentVersionsClient.Get. +type RegistryEnvironmentVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + EnvironmentVersion +} + +// RegistryEnvironmentVersionsClientListResponse contains the response from method RegistryEnvironmentVersionsClient.NewListPager. +type RegistryEnvironmentVersionsClientListResponse struct { + // A paginated list of EnvironmentVersion entities. + EnvironmentVersionResourceArmPaginatedResult +} + +// RegistryModelContainersClientCreateOrUpdateResponse contains the response from method RegistryModelContainersClient.BeginCreateOrUpdate. +type RegistryModelContainersClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + ModelContainer +} + +// RegistryModelContainersClientDeleteResponse contains the response from method RegistryModelContainersClient.BeginDelete. +type RegistryModelContainersClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryModelContainersClientGetResponse contains the response from method RegistryModelContainersClient.Get. +type RegistryModelContainersClientGetResponse struct { + // Azure Resource Manager resource envelope. + ModelContainer +} + +// RegistryModelContainersClientListResponse contains the response from method RegistryModelContainersClient.NewListPager. +type RegistryModelContainersClientListResponse struct { + // A paginated list of ModelContainer entities. + ModelContainerResourceArmPaginatedResult +} + +// RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse contains the response from method RegistryModelVersionsClient.CreateOrGetStartPendingUpload. +type RegistryModelVersionsClientCreateOrGetStartPendingUploadResponse struct { + PendingUploadResponseDto +} + +// RegistryModelVersionsClientCreateOrUpdateResponse contains the response from method RegistryModelVersionsClient.BeginCreateOrUpdate. +type RegistryModelVersionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + ModelVersion +} + +// RegistryModelVersionsClientDeleteResponse contains the response from method RegistryModelVersionsClient.BeginDelete. +type RegistryModelVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// RegistryModelVersionsClientGetResponse contains the response from method RegistryModelVersionsClient.Get. +type RegistryModelVersionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + ModelVersion +} + +// RegistryModelVersionsClientListResponse contains the response from method RegistryModelVersionsClient.NewListPager. +type RegistryModelVersionsClientListResponse struct { + // A paginated list of ModelVersion entities. + ModelVersionResourceArmPaginatedResult +} + +// RegistryModelVersionsClientPackageResponse contains the response from method RegistryModelVersionsClient.BeginPackage. +type RegistryModelVersionsClientPackageResponse struct { + // Package response returned after async package operation completes successfully. + PackageResponse +} + // SchedulesClientCreateOrUpdateResponse contains the response from method SchedulesClient.BeginCreateOrUpdate. type SchedulesClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. Schedule } @@ -511,21 +1252,68 @@ type SchedulesClientDeleteResponse struct { // SchedulesClientGetResponse contains the response from method SchedulesClient.Get. type SchedulesClientGetResponse struct { + // Azure Resource Manager resource envelope. Schedule } // SchedulesClientListResponse contains the response from method SchedulesClient.NewListPager. type SchedulesClientListResponse struct { + // A paginated list of Schedule entities. ScheduleResourceArmPaginatedResult } +// ServerlessEndpointsClientCreateOrUpdateResponse contains the response from method ServerlessEndpointsClient.BeginCreateOrUpdate. +type ServerlessEndpointsClientCreateOrUpdateResponse struct { + ServerlessEndpoint +} + +// ServerlessEndpointsClientDeleteResponse contains the response from method ServerlessEndpointsClient.BeginDelete. +type ServerlessEndpointsClientDeleteResponse struct { + // placeholder for future response values +} + +// ServerlessEndpointsClientGetResponse contains the response from method ServerlessEndpointsClient.Get. +type ServerlessEndpointsClientGetResponse struct { + ServerlessEndpoint +} + +// ServerlessEndpointsClientGetStatusResponse contains the response from method ServerlessEndpointsClient.GetStatus. +type ServerlessEndpointsClientGetStatusResponse struct { + ServerlessEndpointStatus +} + +// ServerlessEndpointsClientListKeysResponse contains the response from method ServerlessEndpointsClient.ListKeys. +type ServerlessEndpointsClientListKeysResponse struct { + // Keys for endpoint authentication. + EndpointAuthKeys +} + +// ServerlessEndpointsClientListResponse contains the response from method ServerlessEndpointsClient.NewListPager. +type ServerlessEndpointsClientListResponse struct { + // A paginated list of ServerlessEndpoint entities. + ServerlessEndpointTrackedResourceArmPaginatedResult +} + +// ServerlessEndpointsClientRegenerateKeysResponse contains the response from method ServerlessEndpointsClient.BeginRegenerateKeys. +type ServerlessEndpointsClientRegenerateKeysResponse struct { + // Keys for endpoint authentication. + EndpointAuthKeys +} + +// ServerlessEndpointsClientUpdateResponse contains the response from method ServerlessEndpointsClient.BeginUpdate. +type ServerlessEndpointsClientUpdateResponse struct { + ServerlessEndpoint +} + // UsagesClientListResponse contains the response from method UsagesClient.NewListPager. type UsagesClientListResponse struct { + // The List Usages operation response. ListUsagesResult } // VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.List. type VirtualMachineSizesClientListResponse struct { + // The List Virtual Machine size operation response. VirtualMachineSizeListResult } @@ -549,13 +1337,30 @@ type WorkspaceConnectionsClientListResponse struct { WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult } +// WorkspaceConnectionsClientListSecretsResponse contains the response from method WorkspaceConnectionsClient.ListSecrets. +type WorkspaceConnectionsClientListSecretsResponse struct { + WorkspaceConnectionPropertiesV2BasicResource +} + +// WorkspaceConnectionsClientTestConnectionResponse contains the response from method WorkspaceConnectionsClient.BeginTestConnection. +type WorkspaceConnectionsClientTestConnectionResponse struct { + // placeholder for future response values +} + +// WorkspaceConnectionsClientUpdateResponse contains the response from method WorkspaceConnectionsClient.Update. +type WorkspaceConnectionsClientUpdateResponse struct { + WorkspaceConnectionPropertiesV2BasicResource +} + // WorkspaceFeaturesClientListResponse contains the response from method WorkspaceFeaturesClient.NewListPager. type WorkspaceFeaturesClientListResponse struct { + // The List Aml user feature operation response. ListAmlUserFeatureResult } // WorkspacesClientCreateOrUpdateResponse contains the response from method WorkspacesClient.BeginCreateOrUpdate. type WorkspacesClientCreateOrUpdateResponse struct { + // An object that represents a machine learning workspace. Workspace } @@ -571,16 +1376,19 @@ type WorkspacesClientDiagnoseResponse struct { // WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get. type WorkspacesClientGetResponse struct { + // An object that represents a machine learning workspace. Workspace } // WorkspacesClientListByResourceGroupResponse contains the response from method WorkspacesClient.NewListByResourceGroupPager. type WorkspacesClientListByResourceGroupResponse struct { + // The result of a request to list machine learning workspaces. WorkspaceListResult } // WorkspacesClientListBySubscriptionResponse contains the response from method WorkspacesClient.NewListBySubscriptionPager. type WorkspacesClientListBySubscriptionResponse struct { + // The result of a request to list machine learning workspaces. WorkspaceListResult } @@ -621,5 +1429,6 @@ type WorkspacesClientResyncKeysResponse struct { // WorkspacesClientUpdateResponse contains the response from method WorkspacesClient.BeginUpdate. type WorkspacesClientUpdateResponse struct { + // An object that represents a machine learning workspace. Workspace } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go index 9a49a581f556..3c978a6a74ab 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type SchedulesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SchedulesClient, error) { - cl, err := arm.NewClient(moduleName+".SchedulesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,7 +46,7 @@ func NewSchedulesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Create or update schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Schedule name. @@ -60,29 +59,41 @@ func (client *SchedulesClient) BeginCreateOrUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[SchedulesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SchedulesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SchedulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SchedulesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Create or update schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *SchedulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body Schedule, options *SchedulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "SchedulesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,16 +120,19 @@ func (client *SchedulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Schedule name. @@ -129,29 +143,41 @@ func (client *SchedulesClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[SchedulesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SchedulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SchedulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SchedulesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Delete schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *SchedulesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *SchedulesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "SchedulesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -178,7 +204,7 @@ func (client *SchedulesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,24 +213,31 @@ func (client *SchedulesClient) deleteCreateRequest(ctx context.Context, resource // Get - Get schedule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Schedule name. // - options - SchedulesClientGetOptions contains the optional parameters for the SchedulesClient.Get method. func (client *SchedulesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *SchedulesClientGetOptions) (SchedulesClientGetResponse, error) { + var err error + const operationName = "SchedulesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) if err != nil { return SchedulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SchedulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SchedulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SchedulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -231,7 +264,7 @@ func (client *SchedulesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +281,7 @@ func (client *SchedulesClient) getHandleResponse(resp *http.Response) (Schedules // NewListPager - List schedules in specified workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - SchedulesClientListOptions contains the optional parameters for the SchedulesClient.NewListPager method. @@ -258,25 +291,20 @@ func (client *SchedulesClient) NewListPager(resourceGroupName string, workspaceN return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *SchedulesClientListResponse) (SchedulesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SchedulesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return SchedulesClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SchedulesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SchedulesClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -300,7 +328,7 @@ func (client *SchedulesClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client_example_test.go deleted file mode 100644 index c6a64ae0532d..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client_example_test.go +++ /dev/null @@ -1,253 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/list.json -func ExampleSchedulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSchedulesClient().NewListPager("test-rg", "my-aml-workspace", &armmachinelearning.SchedulesClientListOptions{Skip: nil, - ListViewType: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScheduleResourceArmPaginatedResult = armmachinelearning.ScheduleResourceArmPaginatedResult{ - // Value: []*armmachinelearning.Schedule{ - // { - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeKey), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeApplication), - // }, - // Properties: &armmachinelearning.ScheduleProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Action: &armmachinelearning.EndpointScheduleAction{ - // ActionType: to.Ptr(armmachinelearning.ScheduleActionTypeInvokeBatchEndpoint), - // EndpointInvocationDefinition: map[string]any{ - // "00cd1396-a094-4d48-8d86-14c43a55a6af": nil, - // }, - // }, - // DisplayName: to.Ptr("string"), - // IsEnabled: to.Ptr(false), - // ProvisioningState: to.Ptr(armmachinelearning.ScheduleProvisioningStatusSucceeded), - // Trigger: &armmachinelearning.CronTrigger{ - // EndTime: to.Ptr("string"), - // StartTime: to.Ptr("string"), - // TimeZone: to.Ptr("string"), - // TriggerType: to.Ptr(armmachinelearning.TriggerTypeCron), - // Expression: to.Ptr("string"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/delete.json -func ExampleSchedulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSchedulesClient().BeginDelete(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/get.json -func ExampleSchedulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSchedulesClient().Get(ctx, "test-rg", "my-aml-workspace", "string", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Schedule = armmachinelearning.Schedule{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeKey), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeKey), - // }, - // Properties: &armmachinelearning.ScheduleProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Action: &armmachinelearning.EndpointScheduleAction{ - // ActionType: to.Ptr(armmachinelearning.ScheduleActionTypeInvokeBatchEndpoint), - // EndpointInvocationDefinition: map[string]any{ - // "a108545b-def1-4c86-8e53-dbcb1de3a8bc": nil, - // }, - // }, - // DisplayName: to.Ptr("string"), - // IsEnabled: to.Ptr(false), - // ProvisioningState: to.Ptr(armmachinelearning.ScheduleProvisioningStatusSucceeded), - // Trigger: &armmachinelearning.CronTrigger{ - // EndTime: to.Ptr("string"), - // StartTime: to.Ptr("string"), - // TimeZone: to.Ptr("string"), - // TriggerType: to.Ptr(armmachinelearning.TriggerTypeCron), - // Expression: to.Ptr("string"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Schedule/createOrUpdate.json -func ExampleSchedulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSchedulesClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-workspace", "string", armmachinelearning.Schedule{ - Properties: &armmachinelearning.ScheduleProperties{ - Description: to.Ptr("string"), - Properties: map[string]*string{ - "string": to.Ptr("string"), - }, - Tags: map[string]*string{ - "string": to.Ptr("string"), - }, - Action: &armmachinelearning.EndpointScheduleAction{ - ActionType: to.Ptr(armmachinelearning.ScheduleActionTypeInvokeBatchEndpoint), - EndpointInvocationDefinition: map[string]any{ - "9965593e-526f-4b89-bb36-761138cf2794": nil, - }, - }, - DisplayName: to.Ptr("string"), - IsEnabled: to.Ptr(false), - Trigger: &armmachinelearning.CronTrigger{ - EndTime: to.Ptr("string"), - StartTime: to.Ptr("string"), - TimeZone: to.Ptr("string"), - TriggerType: to.Ptr(armmachinelearning.TriggerTypeCron), - Expression: to.Ptr("string"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Schedule = armmachinelearning.Schedule{ - // Name: to.Ptr("string"), - // Type: to.Ptr("string"), - // ID: to.Ptr("string"), - // SystemData: &armmachinelearning.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeKey), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeApplication), - // }, - // Properties: &armmachinelearning.ScheduleProperties{ - // Description: to.Ptr("string"), - // Properties: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Tags: map[string]*string{ - // "string": to.Ptr("string"), - // }, - // Action: &armmachinelearning.EndpointScheduleAction{ - // ActionType: to.Ptr(armmachinelearning.ScheduleActionTypeInvokeBatchEndpoint), - // EndpointInvocationDefinition: map[string]any{ - // "d77a9a9a-4bb5-4c0c-8a77-459be8b82b9f": nil, - // }, - // }, - // DisplayName: to.Ptr("string"), - // IsEnabled: to.Ptr(false), - // ProvisioningState: to.Ptr(armmachinelearning.ScheduleProvisioningStatusSucceeded), - // Trigger: &armmachinelearning.CronTrigger{ - // EndTime: to.Ptr("string"), - // StartTime: to.Ptr("string"), - // TimeZone: to.Ptr("string"), - // TriggerType: to.Ptr(armmachinelearning.TriggerTypeCron), - // Expression: to.Ptr("string"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/serverlessendpoints_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/serverlessendpoints_client.go new file mode 100644 index 000000000000..e1956b256c8a --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/serverlessendpoints_client.go @@ -0,0 +1,660 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armmachinelearning + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ServerlessEndpointsClient contains the methods for the ServerlessEndpoints group. +// Don't use this type directly, use NewServerlessEndpointsClient() instead. +type ServerlessEndpointsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServerlessEndpointsClient creates a new instance of ServerlessEndpointsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServerlessEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerlessEndpointsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServerlessEndpointsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update Serverless Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - body - Serverless Endpoint entity to apply during operation. +// - options - ServerlessEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerlessEndpointsClient.BeginCreateOrUpdate +// method. +func (client *ServerlessEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ServerlessEndpoint, options *ServerlessEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerlessEndpointsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerlessEndpointsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerlessEndpointsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update Serverless Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ServerlessEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ServerlessEndpoint, options *ServerlessEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ServerlessEndpointsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServerlessEndpointsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body ServerlessEndpoint, options *ServerlessEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete Serverless Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - options - ServerlessEndpointsClientBeginDeleteOptions contains the optional parameters for the ServerlessEndpointsClient.BeginDelete +// method. +func (client *ServerlessEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientBeginDeleteOptions) (*runtime.Poller[ServerlessEndpointsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerlessEndpointsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerlessEndpointsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Serverless Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ServerlessEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ServerlessEndpointsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ServerlessEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get Serverless Endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - options - ServerlessEndpointsClientGetOptions contains the optional parameters for the ServerlessEndpointsClient.Get method. +func (client *ServerlessEndpointsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientGetOptions) (ServerlessEndpointsClientGetResponse, error) { + var err error + const operationName = "ServerlessEndpointsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ServerlessEndpointsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerlessEndpointsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerlessEndpointsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ServerlessEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServerlessEndpointsClient) getHandleResponse(resp *http.Response) (ServerlessEndpointsClientGetResponse, error) { + result := ServerlessEndpointsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerlessEndpoint); err != nil { + return ServerlessEndpointsClientGetResponse{}, err + } + return result, nil +} + +// GetStatus - Status of the model backing the Serverless Endpoint. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - options - ServerlessEndpointsClientGetStatusOptions contains the optional parameters for the ServerlessEndpointsClient.GetStatus +// method. +func (client *ServerlessEndpointsClient) GetStatus(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientGetStatusOptions) (ServerlessEndpointsClientGetStatusResponse, error) { + var err error + const operationName = "ServerlessEndpointsClient.GetStatus" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getStatusCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ServerlessEndpointsClientGetStatusResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerlessEndpointsClientGetStatusResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerlessEndpointsClientGetStatusResponse{}, err + } + resp, err := client.getStatusHandleResponse(httpResp) + return resp, err +} + +// getStatusCreateRequest creates the GetStatus request. +func (client *ServerlessEndpointsClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientGetStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/getStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getStatusHandleResponse handles the GetStatus response. +func (client *ServerlessEndpointsClient) getStatusHandleResponse(resp *http.Response) (ServerlessEndpointsClientGetStatusResponse, error) { + result := ServerlessEndpointsClientGetStatusResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerlessEndpointStatus); err != nil { + return ServerlessEndpointsClientGetStatusResponse{}, err + } + return result, nil +} + +// NewListPager - List Serverless Endpoints. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - options - ServerlessEndpointsClientListOptions contains the optional parameters for the ServerlessEndpointsClient.NewListPager +// method. +func (client *ServerlessEndpointsClient) NewListPager(resourceGroupName string, workspaceName string, options *ServerlessEndpointsClientListOptions) *runtime.Pager[ServerlessEndpointsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServerlessEndpointsClientListResponse]{ + More: func(page ServerlessEndpointsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServerlessEndpointsClientListResponse) (ServerlessEndpointsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServerlessEndpointsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return ServerlessEndpointsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ServerlessEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ServerlessEndpointsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServerlessEndpointsClient) listHandleResponse(resp *http.Response) (ServerlessEndpointsClientListResponse, error) { + result := ServerlessEndpointsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerlessEndpointTrackedResourceArmPaginatedResult); err != nil { + return ServerlessEndpointsClientListResponse{}, err + } + return result, nil +} + +// ListKeys - List EndpointAuthKeys for an Endpoint using Key-based authentication. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - options - ServerlessEndpointsClientListKeysOptions contains the optional parameters for the ServerlessEndpointsClient.ListKeys +// method. +func (client *ServerlessEndpointsClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientListKeysOptions) (ServerlessEndpointsClientListKeysResponse, error) { + var err error + const operationName = "ServerlessEndpointsClient.ListKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, name, options) + if err != nil { + return ServerlessEndpointsClientListKeysResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerlessEndpointsClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerlessEndpointsClientListKeysResponse{}, err + } + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err +} + +// listKeysCreateRequest creates the ListKeys request. +func (client *ServerlessEndpointsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *ServerlessEndpointsClientListKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/listKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listKeysHandleResponse handles the ListKeys response. +func (client *ServerlessEndpointsClient) listKeysHandleResponse(resp *http.Response) (ServerlessEndpointsClientListKeysResponse, error) { + result := ServerlessEndpointsClientListKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EndpointAuthKeys); err != nil { + return ServerlessEndpointsClientListKeysResponse{}, err + } + return result, nil +} + +// BeginRegenerateKeys - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - body - RegenerateKeys request . +// - options - ServerlessEndpointsClientBeginRegenerateKeysOptions contains the optional parameters for the ServerlessEndpointsClient.BeginRegenerateKeys +// method. +func (client *ServerlessEndpointsClient) BeginRegenerateKeys(ctx context.Context, resourceGroupName string, workspaceName string, name string, body RegenerateEndpointKeysRequest, options *ServerlessEndpointsClientBeginRegenerateKeysOptions) (*runtime.Poller[ServerlessEndpointsClientRegenerateKeysResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.regenerateKeys(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerlessEndpointsClientRegenerateKeysResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerlessEndpointsClientRegenerateKeysResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// RegenerateKeys - Regenerate EndpointAuthKeys for an Endpoint using Key-based authentication (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ServerlessEndpointsClient) regenerateKeys(ctx context.Context, resourceGroupName string, workspaceName string, name string, body RegenerateEndpointKeysRequest, options *ServerlessEndpointsClientBeginRegenerateKeysOptions) (*http.Response, error) { + var err error + const operationName = "ServerlessEndpointsClient.BeginRegenerateKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.regenerateKeysCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// regenerateKeysCreateRequest creates the RegenerateKeys request. +func (client *ServerlessEndpointsClient) regenerateKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body RegenerateEndpointKeysRequest, options *ServerlessEndpointsClientBeginRegenerateKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}/regenerateKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginUpdate - Update Serverless Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Serverless Endpoint name. +// - body - Serverless Endpoint entity to apply during operation. +// - options - ServerlessEndpointsClientBeginUpdateOptions contains the optional parameters for the ServerlessEndpointsClient.BeginUpdate +// method. +func (client *ServerlessEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *ServerlessEndpointsClientBeginUpdateOptions) (*runtime.Poller[ServerlessEndpointsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerlessEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServerlessEndpointsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update Serverless Endpoint (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ServerlessEndpointsClient) update(ctx context.Context, resourceGroupName string, workspaceName string, name string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *ServerlessEndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ServerlessEndpointsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, name, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ServerlessEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body PartialMinimalTrackedResourceWithSKUAndIdentity, options *ServerlessEndpointsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/time_rfc3339.go b/sdk/resourcemanager/machinelearning/armmachinelearning/time_rfc3339.go index f420dc3b6cea..f74d9b2ed5e4 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/time_rfc3339.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -19,50 +18,50 @@ import ( "time" ) -const ( - utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` - utcLayout = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` -) - // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) -type timeRFC3339 time.Time +const ( + utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` + utcDateTime = "2006-01-02T15:04:05.999999999" + dateTimeJSON = `"` + time.RFC3339Nano + `"` +) + +type dateTimeRFC3339 time.Time -func (t timeRFC3339) MarshalJSON() (json []byte, err error) { +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { tt := time.Time(t) return tt.MarshalJSON() } -func (t timeRFC3339) MarshalText() (text []byte, err error) { +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { tt := time.Time(t) return tt.MarshalText() } -func (t *timeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcLayoutJSON +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcDateTimeJSON if tzOffsetRegex.Match(data) { - layout = rfc3339JSON + layout = dateTimeJSON } return t.Parse(layout, string(data)) } -func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { - layout := utcLayout +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + layout := utcDateTime if tzOffsetRegex.Match(data) { layout = time.RFC3339Nano } return t.Parse(layout, string(data)) } -func (t *timeRFC3339) Parse(layout, value string) error { +func (t *dateTimeRFC3339) Parse(layout, value string) error { p, err := time.Parse(layout, strings.ToUpper(value)) - *t = timeRFC3339(p) + *t = dateTimeRFC3339(p) return err } -func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { @@ -71,14 +70,14 @@ func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { } else if reflect.ValueOf(t).IsNil() { return } - m[k] = (*timeRFC3339)(t) + m[k] = (*dateTimeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { if data == nil || strings.EqualFold(string(data), "null") { return nil } - var aux timeRFC3339 + var aux dateTimeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { return fmt.Errorf("struct field %s: %v", fn, err) } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go index d1502a42de3e..d49d8b017b5b 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type UsagesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { - cl, err := arm.NewClient(moduleName+".UsagesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +45,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - Gets the current usage information as well as limits for AML resources for given subscription and location. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - location - The location for which resource usage is queried. // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { @@ -55,25 +54,20 @@ func (client *UsagesClient) NewListPager(location string, options *UsagesClientL return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *UsagesClientListResponse) (UsagesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, location, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsagesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, location, options) + }, nil) if err != nil { return UsagesClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return UsagesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UsagesClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -93,7 +87,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client_example_test.go deleted file mode 100644 index e3b70a9c0454..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client_example_test.go +++ /dev/null @@ -1,431 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Usage/list.json -func ExampleUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListUsagesResult = armmachinelearning.ListUsagesResult{ - // Value: []*armmachinelearning.Usage{ - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Clusters"), - // Value: to.Ptr("Clusters"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/totalCores/usages"), - // CurrentValue: to.Ptr[int64](7), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages"), - // Limit: to.Ptr[int64](100), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Total Cluster Dedicated Regional vCPUs"), - // Value: to.Ptr("Total Cluster Dedicated Regional vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/dedicatedCores/usages"), - // CurrentValue: to.Ptr[int64](14), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard D Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_D_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](48), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/usages"), - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/usages/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes/usages"), - // CurrentValue: to.Ptr[int64](2), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/computes/demo_cluster1_dsv2/usages/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/computes/demo_cluster2_dsv2/usages/Standard_DSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard Dv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_Dv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard FSv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_FSv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](12), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/usages/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/computes/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/computes/demo_cluster1_nc/usages/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/usages/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/computes/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/computes/demo_cluser1_nc/usages/Standard_NC_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NCv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NCv3 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NCv3_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard ND Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_ND_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NDv2 Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NDv2_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](0), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // Value: to.Ptr("Standard NV Family Cluster Dedicated vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NV_Family_Cluster_Dedicated_vCPUs"), - // Limit: to.Ptr[int64](24), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Total Cluster LowPriority Regional vCPUs"), - // Value: to.Ptr("Total Cluster LowPriority Regional vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/lowPriorityCores/usages"), - // CurrentValue: to.Ptr[int64](18), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages"), - // Limit: to.Ptr[int64](50), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard D Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard D Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_D_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard DSv2 Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard DSv2 Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_DSv2_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard Dv2 Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard Dv2 Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_Dv2_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard FSv2 Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard FSv2 Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_FSv2_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](18), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NC_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/usages/Standard_NC_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/computes/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace1/computes/demo_cluster1_lowPriority_nc/usages/Standard_NC_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/usages"), - // CurrentValue: to.Ptr[int64](12), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/usages/Standard_NC_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/computes/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/computes/demo_cluster2_lowPriority_nc/usages/Standard_NC_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NC Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/workspace/computes/usages"), - // CurrentValue: to.Ptr[int64](6), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/computes/demo_cluster3_lowPriority_nc/usages/Standard_NC_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NCv2 Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NCv2 Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NCv2_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NCv3 Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NCv3 Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NCv3_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard ND Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard ND Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_ND_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NDv2 Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NDv2 Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NDv2_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }, - // { - // Name: &armmachinelearning.UsageName{ - // LocalizedValue: to.Ptr("Standard NV Family Cluster LowPriority vCPUs"), - // Value: to.Ptr("Standard NV Family Cluster LowPriority vCPUs"), - // }, - // Type: to.Ptr("Microsoft.MachineLearningServices/vmFamily/usages"), - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/usages/Standard_NV_Family_Cluster_LowPriority_vCPUs"), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armmachinelearning.UsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client.go index 153c5e856b4d..e14074678e22 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type VirtualMachineSizesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error) { - cl, err := arm.NewClient(moduleName+".VirtualMachineSizesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,23 +46,30 @@ func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.Token // List - Returns supported VM Sizes in a location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - location - The location upon which virtual-machine-sizes is queried. // - options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List // method. func (client *VirtualMachineSizesClient) List(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (VirtualMachineSizesClientListResponse, error) { + var err error + const operationName = "VirtualMachineSizesClient.List" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listCreateRequest(ctx, location, options) if err != nil { return VirtualMachineSizesClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VirtualMachineSizesClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineSizesClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualMachineSizesClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -82,7 +88,7 @@ func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client_example_test.go deleted file mode 100644 index 4406ae32cdef..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client_example_test.go +++ /dev/null @@ -1,396 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/VirtualMachineSize/list.json -func ExampleVirtualMachineSizesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineSizesClient().List(ctx, "eastus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineSizeListResult = armmachinelearning.VirtualMachineSizeListResult{ - // Value: []*armmachinelearning.VirtualMachineSize{ - // { - // Name: to.Ptr("Standard_DS1_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.13), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.01), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.07), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.05), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](7168), - // MemoryGB: to.Ptr[float64](3.5), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance")}, - // VCPUs: to.Ptr[int32](1), - // }, - // { - // Name: to.Ptr("Standard_DS2_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.03), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.15), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.1), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.25), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](14336), - // MemoryGB: to.Ptr[float64](7), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance"), - // to.Ptr("MIR")}, - // VCPUs: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_DS3_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.2), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.06), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.5), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.29), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](28672), - // MemoryGB: to.Ptr[float64](14), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance"), - // to.Ptr("MIR")}, - // VCPUs: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_DS4_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.12), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.4), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](1.01), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.58), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](57344), - // MemoryGB: to.Ptr[float64](28), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance"), - // to.Ptr("MIR")}, - // VCPUs: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_DS5_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](1.17), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.81), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](2.02), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.23), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](114688), - // MemoryGB: to.Ptr[float64](56), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance"), - // to.Ptr("MIR")}, - // VCPUs: to.Ptr[int32](16), - // }, - // { - // Name: to.Ptr("Standard_DS11_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.26), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.18), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.11), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.04), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](28672), - // MemoryGB: to.Ptr[float64](14), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance")}, - // VCPUs: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("Standard_DS12_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.37), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.53), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.21), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.07), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](57344), - // MemoryGB: to.Ptr[float64](28), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance")}, - // VCPUs: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("Standard_DS13_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.15), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.42), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.74), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](1.06), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](114688), - // MemoryGB: to.Ptr[float64](56), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance")}, - // VCPUs: to.Ptr[int32](8), - // }, - // { - // Name: to.Ptr("Standard_DS14_v2"), - // EstimatedVMPrices: &armmachinelearning.EstimatedVMPrices{ - // BillingCurrency: to.Ptr(armmachinelearning.BillingCurrencyUSD), - // UnitOfMeasure: to.Ptr(armmachinelearning.UnitOfMeasureOneHour), - // Values: []*armmachinelearning.EstimatedVMPrice{ - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](0.3), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeLinux), - // RetailPrice: to.Ptr[float64](1.48), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](0.84), - // VMTier: to.Ptr(armmachinelearning.VMTierLowPriority), - // }, - // { - // OSType: to.Ptr(armmachinelearning.VMPriceOSTypeWindows), - // RetailPrice: to.Ptr[float64](2.11), - // VMTier: to.Ptr(armmachinelearning.VMTierStandard), - // }}, - // }, - // Family: to.Ptr("standardDSv2Family"), - // Gpus: to.Ptr[int32](0), - // LowPriorityCapable: to.Ptr(true), - // MaxResourceVolumeMB: to.Ptr[int32](229376), - // MemoryGB: to.Ptr[float64](112), - // OSVhdSizeMB: to.Ptr[int32](1047552), - // PremiumIO: to.Ptr(true), - // SupportedComputeTypes: []*string{ - // to.Ptr("AmlCompute"), - // to.Ptr("ComputeInstance")}, - // VCPUs: to.Ptr[int32](16), - // }}, - // } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client.go index ead48db60a4d..cc0f7234cc2f 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type WorkspaceConnectionsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewWorkspaceConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspaceConnectionsClient, error) { - cl, err := arm.NewClient(moduleName+".WorkspaceConnectionsClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -44,33 +43,39 @@ func NewWorkspaceConnectionsClient(subscriptionID string, credential azcore.Toke return client, nil } -// Create - +// Create - Create or update machine learning workspaces connections under the specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - connectionName - Friendly name of the workspace connection -// - parameters - The object for creating or updating a new workspace connection // - options - WorkspaceConnectionsClientCreateOptions contains the optional parameters for the WorkspaceConnectionsClient.Create // method. -func (client *WorkspaceConnectionsClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, parameters WorkspaceConnectionPropertiesV2BasicResource, options *WorkspaceConnectionsClientCreateOptions) (WorkspaceConnectionsClientCreateResponse, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, parameters, options) +func (client *WorkspaceConnectionsClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientCreateOptions) (WorkspaceConnectionsClientCreateResponse, error) { + var err error + const operationName = "WorkspaceConnectionsClient.Create" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) if err != nil { return WorkspaceConnectionsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceConnectionsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceConnectionsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceConnectionsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. -func (client *WorkspaceConnectionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, parameters WorkspaceConnectionPropertiesV2BasicResource, options *WorkspaceConnectionsClientCreateOptions) (*policy.Request, error) { +func (client *WorkspaceConnectionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,10 +98,16 @@ func (client *WorkspaceConnectionsClient) createCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil + } + return req, nil } // createHandleResponse handles the Create response. @@ -108,26 +119,32 @@ func (client *WorkspaceConnectionsClient) createHandleResponse(resp *http.Respon return result, nil } -// Delete - +// Delete - Delete machine learning workspaces connections by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - connectionName - Friendly name of the workspace connection // - options - WorkspaceConnectionsClientDeleteOptions contains the optional parameters for the WorkspaceConnectionsClient.Delete // method. func (client *WorkspaceConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientDeleteOptions) (WorkspaceConnectionsClientDeleteResponse, error) { + var err error + const operationName = "WorkspaceConnectionsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) if err != nil { return WorkspaceConnectionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceConnectionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return WorkspaceConnectionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return WorkspaceConnectionsClientDeleteResponse{}, err } return WorkspaceConnectionsClientDeleteResponse{}, nil } @@ -156,34 +173,41 @@ func (client *WorkspaceConnectionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - +// Get - Lists machine learning workspaces connections by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - connectionName - Friendly name of the workspace connection // - options - WorkspaceConnectionsClientGetOptions contains the optional parameters for the WorkspaceConnectionsClient.Get // method. func (client *WorkspaceConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientGetOptions) (WorkspaceConnectionsClientGetResponse, error) { + var err error + const operationName = "WorkspaceConnectionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) if err != nil { return WorkspaceConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -210,7 +234,10 @@ func (client *WorkspaceConnectionsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + if options != nil && options.AoaiModelsToDeploy != nil { + reqQP.Set("aoaiModelsToDeploy", *options.AoaiModelsToDeploy) + } + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,8 +252,11 @@ func (client *WorkspaceConnectionsClient) getHandleResponse(resp *http.Response) return result, nil } +// NewListPager - Lists all the available machine learning workspaces connections under the specified workspace. +// +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspaceConnectionsClientListOptions contains the optional parameters for the WorkspaceConnectionsClient.NewListPager // method. func (client *WorkspaceConnectionsClient) NewListPager(resourceGroupName string, workspaceName string, options *WorkspaceConnectionsClientListOptions) *runtime.Pager[WorkspaceConnectionsClientListResponse] { @@ -235,25 +265,20 @@ func (client *WorkspaceConnectionsClient) NewListPager(resourceGroupName string, return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *WorkspaceConnectionsClientListResponse) (WorkspaceConnectionsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return WorkspaceConnectionsClientListResponse{}, err + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WorkspaceConnectionsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return WorkspaceConnectionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -283,7 +308,7 @@ func (client *WorkspaceConnectionsClient) listCreateRequest(ctx context.Context, if options != nil && options.Category != nil { reqQP.Set("category", *options.Category) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,3 +322,239 @@ func (client *WorkspaceConnectionsClient) listHandleResponse(resp *http.Response } return result, nil } + +// ListSecrets - List all the secrets of a machine learning workspaces connections. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - connectionName - Friendly name of the workspace connection +// - options - WorkspaceConnectionsClientListSecretsOptions contains the optional parameters for the WorkspaceConnectionsClient.ListSecrets +// method. +func (client *WorkspaceConnectionsClient) ListSecrets(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientListSecretsOptions) (WorkspaceConnectionsClientListSecretsResponse, error) { + var err error + const operationName = "WorkspaceConnectionsClient.ListSecrets" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) + if err != nil { + return WorkspaceConnectionsClientListSecretsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WorkspaceConnectionsClientListSecretsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceConnectionsClientListSecretsResponse{}, err + } + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err +} + +// listSecretsCreateRequest creates the ListSecrets request. +func (client *WorkspaceConnectionsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientListSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/listsecrets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.AoaiModelsToDeploy != nil { + reqQP.Set("aoaiModelsToDeploy", *options.AoaiModelsToDeploy) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecretsHandleResponse handles the ListSecrets response. +func (client *WorkspaceConnectionsClient) listSecretsHandleResponse(resp *http.Response) (WorkspaceConnectionsClientListSecretsResponse, error) { + result := WorkspaceConnectionsClientListSecretsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceConnectionPropertiesV2BasicResource); err != nil { + return WorkspaceConnectionsClientListSecretsResponse{}, err + } + return result, nil +} + +// BeginTestConnection - Test machine learning workspaces connections under the specified workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - connectionName - Friendly name of the workspace connection +// - options - WorkspaceConnectionsClientBeginTestConnectionOptions contains the optional parameters for the WorkspaceConnectionsClient.BeginTestConnection +// method. +func (client *WorkspaceConnectionsClient) BeginTestConnection(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientBeginTestConnectionOptions) (*runtime.Poller[WorkspaceConnectionsClientTestConnectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.testConnection(ctx, resourceGroupName, workspaceName, connectionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspaceConnectionsClientTestConnectionResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspaceConnectionsClientTestConnectionResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// TestConnection - Test machine learning workspaces connections under the specified workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *WorkspaceConnectionsClient) testConnection(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientBeginTestConnectionOptions) (*http.Response, error) { + var err error + const operationName = "WorkspaceConnectionsClient.BeginTestConnection" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.testConnectionCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// testConnectionCreateRequest creates the TestConnection request. +func (client *WorkspaceConnectionsClient) testConnectionCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientBeginTestConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// Update - Update machine learning workspaces connections under the specified workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Azure Machine Learning Workspace Name +// - connectionName - Friendly name of the workspace connection +// - options - WorkspaceConnectionsClientUpdateOptions contains the optional parameters for the WorkspaceConnectionsClient.Update +// method. +func (client *WorkspaceConnectionsClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientUpdateOptions) (WorkspaceConnectionsClientUpdateResponse, error) { + var err error + const operationName = "WorkspaceConnectionsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, connectionName, options) + if err != nil { + return WorkspaceConnectionsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WorkspaceConnectionsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceConnectionsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *WorkspaceConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, options *WorkspaceConnectionsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if connectionName == "" { + return nil, errors.New("parameter connectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionName}", url.PathEscape(connectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *WorkspaceConnectionsClient) updateHandleResponse(resp *http.Response) (WorkspaceConnectionsClientUpdateResponse, error) { + result := WorkspaceConnectionsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceConnectionPropertiesV2BasicResource); err != nil { + return WorkspaceConnectionsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client_example_test.go deleted file mode 100644 index 6bb9fbadb3ec..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/create.json -func ExampleWorkspaceConnectionsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceConnectionsClient().Create(ctx, "resourceGroup-1", "workspace-1", "connection-1", armmachinelearning.WorkspaceConnectionPropertiesV2BasicResource{ - Properties: &armmachinelearning.NoneAuthTypeWorkspaceConnectionProperties{ - AuthType: to.Ptr(armmachinelearning.ConnectionAuthTypeNone), - Category: to.Ptr(armmachinelearning.ConnectionCategoryContainerRegistry), - Target: to.Ptr("www.facebook.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceConnectionPropertiesV2BasicResource = armmachinelearning.WorkspaceConnectionPropertiesV2BasicResource{ - // Name: to.Ptr("connection-1"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/connections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1/providers/Microsoft.MachineLearningServices/workspaces/workspace-1/connections/connection-1"), - // Properties: &armmachinelearning.NoneAuthTypeWorkspaceConnectionProperties{ - // AuthType: to.Ptr(armmachinelearning.ConnectionAuthTypeNone), - // Category: to.Ptr(armmachinelearning.ConnectionCategoryContainerRegistry), - // Target: to.Ptr("www.facebook.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/get.json -func ExampleWorkspaceConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceConnectionsClient().Get(ctx, "resourceGroup-1", "workspace-1", "connection-1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceConnectionPropertiesV2BasicResource = armmachinelearning.WorkspaceConnectionPropertiesV2BasicResource{ - // Name: to.Ptr("connection-1"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/connections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1/providers/Microsoft.MachineLearningServices/workspaces/workspace-1/connections/connection-1"), - // Properties: &armmachinelearning.NoneAuthTypeWorkspaceConnectionProperties{ - // AuthType: to.Ptr(armmachinelearning.ConnectionAuthTypeNone), - // Category: to.Ptr(armmachinelearning.ConnectionCategoryContainerRegistry), - // Target: to.Ptr("www.facebook.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/delete.json -func ExampleWorkspaceConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspaceConnectionsClient().Delete(ctx, "resourceGroup-1", "workspace-1", "connection-1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceConnection/list.json -func ExampleWorkspaceConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspaceConnectionsClient().NewListPager("resourceGroup-1", "workspace-1", &armmachinelearning.WorkspaceConnectionsClientListOptions{Target: to.Ptr("www.facebook.com"), - Category: to.Ptr("ContainerRegistry"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult = armmachinelearning.WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult{ - // Value: []*armmachinelearning.WorkspaceConnectionPropertiesV2BasicResource{ - // { - // Name: to.Ptr("connection-1"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/connections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1/providers/Microsoft.MachineLearningServices/workspaces/workspace-1/linkedWorkspaces/connection-1"), - // Properties: &armmachinelearning.PATAuthTypeWorkspaceConnectionProperties{ - // AuthType: to.Ptr(armmachinelearning.ConnectionAuthTypePAT), - // Category: to.Ptr(armmachinelearning.ConnectionCategoryContainerRegistry), - // Target: to.Ptr("www.facebook.com"), - // }, - // }, - // { - // Name: to.Ptr("connection-2"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/connections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1/providers/Microsoft.MachineLearningServices/workspaces/workspace-1/linkedWorkspaces/connection-2"), - // Properties: &armmachinelearning.PATAuthTypeWorkspaceConnectionProperties{ - // AuthType: to.Ptr(armmachinelearning.ConnectionAuthTypePAT), - // Category: to.Ptr(armmachinelearning.ConnectionCategoryContainerRegistry), - // Target: to.Ptr("www.facebook.com"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client.go index 92b9911a4aa7..a52fdcc31822 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -33,7 +32,7 @@ type WorkspaceFeaturesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewWorkspaceFeaturesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspaceFeaturesClient, error) { - cl, err := arm.NewClient(moduleName+".WorkspaceFeaturesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -46,7 +45,7 @@ func NewWorkspaceFeaturesClient(subscriptionID string, credential azcore.TokenCr // NewListPager - Lists all enabled features for a workspace // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspaceFeaturesClientListOptions contains the optional parameters for the WorkspaceFeaturesClient.NewListPager @@ -57,25 +56,20 @@ func (client *WorkspaceFeaturesClient) NewListPager(resourceGroupName string, wo return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *WorkspaceFeaturesClientListResponse) (WorkspaceFeaturesClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WorkspaceFeaturesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) if err != nil { return WorkspaceFeaturesClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return WorkspaceFeaturesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceFeaturesClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -99,7 +93,7 @@ func (client *WorkspaceFeaturesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client_example_test.go deleted file mode 100644 index 813ee3f07a2c..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client_example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/WorkspaceFeature/list.json -func ExampleWorkspaceFeaturesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspaceFeaturesClient().NewListPager("myResourceGroup", "testworkspace", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListAmlUserFeatureResult = armmachinelearning.ListAmlUserFeatureResult{ - // Value: []*armmachinelearning.AmlUserFeature{ - // { - // Description: to.Ptr("Create, edit or delete AutoML experiments in the SDK"), - // DisplayName: to.Ptr("Create edit experiments UI"), - // ID: to.Ptr("automatedml_createeditexperimentsui"), - // }, - // { - // Description: to.Ptr("Upgrade workspace from Basic to enterprise from the UI"), - // DisplayName: to.Ptr("Upgrade workspace UI"), - // ID: to.Ptr("workspace_upgradeworkspaceui"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client.go index bef17682289d..4371a9c7c438 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmachinelearning @@ -18,6 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -33,7 +33,7 @@ type WorkspacesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error) { - cl, err := arm.NewClient(moduleName+".WorkspacesClient", moduleVersion, credential, options) + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } @@ -47,45 +47,57 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a workspace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. -// - parameters - The parameters for creating or updating a machine learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name +// - body - The parameters for creating or updating a machine learning workspace. // - options - WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate // method. -func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[WorkspacesClientCreateOrUpdateResponse], error) { +func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, body Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[WorkspacesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, parameters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, body, options) if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[WorkspacesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // CreateOrUpdate - Creates or updates a workspace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 -func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, parameters, options) +// Generated from API version 2024-01-01-preview +func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, body Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, body Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -104,18 +116,21 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a machine learning workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*runtime.Poller[WorkspacesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -123,29 +138,41 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[WorkspacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Delete - Deletes a machine learning workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *WorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -168,7 +195,10 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.ForceToPurge != nil { + reqQP.Set("forceToPurge", strconv.FormatBool(*options.ForceToPurge)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,9 +207,9 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // BeginDiagnose - Diagnose workspace setup issue. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientBeginDiagnoseOptions contains the optional parameters for the WorkspacesClient.BeginDiagnose // method. func (client *WorkspacesClient) BeginDiagnose(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDiagnoseOptions) (*runtime.Poller[WorkspacesClientDiagnoseResponse], error) { @@ -188,31 +218,41 @@ func (client *WorkspacesClient) BeginDiagnose(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientDiagnoseResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientDiagnoseResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[WorkspacesClientDiagnoseResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientDiagnoseResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Diagnose - Diagnose workspace setup issue. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *WorkspacesClient) diagnose(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDiagnoseOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginDiagnose" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.diagnoseCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // diagnoseCreateRequest creates the Diagnose request. @@ -235,11 +275,14 @@ func (client *WorkspacesClient) diagnoseCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -247,23 +290,30 @@ func (client *WorkspacesClient) diagnoseCreateRequest(ctx context.Context, resou // Get - Gets the properties of the specified machine learning workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientGetOptions) (WorkspacesClientGetResponse, error) { + var err error + const operationName = "WorkspacesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -286,7 +336,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +353,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - Lists all the available machine learning workspaces under the specified resource group. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager // method. @@ -313,25 +363,20 @@ func (client *WorkspacesClient) NewListByResourceGroupPager(resourceGroupName st return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *WorkspacesClientListByResourceGroupResponse) (WorkspacesClientListByResourceGroupResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WorkspacesClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) if err != nil { return WorkspacesClientListByResourceGroupResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return WorkspacesClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } return client.listByResourceGroupHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -351,7 +396,10 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Kind != nil { + reqQP.Set("kind", *options.Kind) + } if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } @@ -371,7 +419,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Lists all the available machine learning workspaces under the specified subscription. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -380,25 +428,20 @@ func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesCl return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *WorkspacesClientListBySubscriptionResponse) (WorkspacesClientListBySubscriptionResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listBySubscriptionCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WorkspacesClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) if err != nil { return WorkspacesClientListBySubscriptionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return WorkspacesClientListBySubscriptionResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) - } return client.listBySubscriptionHandleResponse(resp) }, + Tracer: client.internal.Tracer(), }) } @@ -414,7 +457,10 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") + if options != nil && options.Kind != nil { + reqQP.Set("kind", *options.Kind) + } if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } @@ -433,26 +479,33 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp } // ListKeys - Lists all the keys associated with this workspace. This includes keys for the storage account, app insights -// and password for container registry +// and password for container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientListKeysOptions contains the optional parameters for the WorkspacesClient.ListKeys method. func (client *WorkspacesClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListKeysOptions) (WorkspacesClientListKeysResponse, error) { + var err error + const operationName = "WorkspacesClient.ListKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientListKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientListKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientListKeysResponse{}, err } - return client.listKeysHandleResponse(resp) + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err } // listKeysCreateRequest creates the ListKeys request. @@ -475,7 +528,7 @@ func (client *WorkspacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -490,27 +543,34 @@ func (client *WorkspacesClient) listKeysHandleResponse(resp *http.Response) (Wor return result, nil } -// ListNotebookAccessToken - return notebook access token and refresh token +// ListNotebookAccessToken - Get Azure Machine Learning Workspace notebook access token // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientListNotebookAccessTokenOptions contains the optional parameters for the WorkspacesClient.ListNotebookAccessToken // method. func (client *WorkspacesClient) ListNotebookAccessToken(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListNotebookAccessTokenOptions) (WorkspacesClientListNotebookAccessTokenResponse, error) { + var err error + const operationName = "WorkspacesClient.ListNotebookAccessToken" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listNotebookAccessTokenCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientListNotebookAccessTokenResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientListNotebookAccessTokenResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListNotebookAccessTokenResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientListNotebookAccessTokenResponse{}, err } - return client.listNotebookAccessTokenHandleResponse(resp) + resp, err := client.listNotebookAccessTokenHandleResponse(httpResp) + return resp, err } // listNotebookAccessTokenCreateRequest creates the ListNotebookAccessToken request. @@ -533,7 +593,7 @@ func (client *WorkspacesClient) listNotebookAccessTokenCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -548,27 +608,34 @@ func (client *WorkspacesClient) listNotebookAccessTokenHandleResponse(resp *http return result, nil } -// ListNotebookKeys - List keys of a notebook. +// ListNotebookKeys - Lists keys of Azure Machine Learning Workspaces notebook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientListNotebookKeysOptions contains the optional parameters for the WorkspacesClient.ListNotebookKeys // method. func (client *WorkspacesClient) ListNotebookKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListNotebookKeysOptions) (WorkspacesClientListNotebookKeysResponse, error) { + var err error + const operationName = "WorkspacesClient.ListNotebookKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listNotebookKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientListNotebookKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientListNotebookKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListNotebookKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientListNotebookKeysResponse{}, err } - return client.listNotebookKeysHandleResponse(resp) + resp, err := client.listNotebookKeysHandleResponse(httpResp) + return resp, err } // listNotebookKeysCreateRequest creates the ListNotebookKeys request. @@ -591,7 +658,7 @@ func (client *WorkspacesClient) listNotebookKeysCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -610,24 +677,31 @@ func (client *WorkspacesClient) listNotebookKeysHandleResponse(resp *http.Respon // (FQDNs) programmatically. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the WorkspacesClient.ListOutboundNetworkDependenciesEndpoints // method. func (client *WorkspacesClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions) (WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse, error) { + var err error + const operationName = "WorkspacesClient.ListOutboundNetworkDependenciesEndpoints" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientListOutboundNetworkDependenciesEndpointsResponse{}, err } - return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) + resp, err := client.listOutboundNetworkDependenciesEndpointsHandleResponse(httpResp) + return resp, err } // listOutboundNetworkDependenciesEndpointsCreateRequest creates the ListOutboundNetworkDependenciesEndpoints request. @@ -650,7 +724,7 @@ func (client *WorkspacesClient) listOutboundNetworkDependenciesEndpointsCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -665,27 +739,34 @@ func (client *WorkspacesClient) listOutboundNetworkDependenciesEndpointsHandleRe return result, nil } -// ListStorageAccountKeys - List storage account keys of a workspace. +// ListStorageAccountKeys - Lists keys of Azure Machine Learning Workspace's storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientListStorageAccountKeysOptions contains the optional parameters for the WorkspacesClient.ListStorageAccountKeys // method. func (client *WorkspacesClient) ListStorageAccountKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientListStorageAccountKeysOptions) (WorkspacesClientListStorageAccountKeysResponse, error) { + var err error + const operationName = "WorkspacesClient.ListStorageAccountKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.listStorageAccountKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientListStorageAccountKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientListStorageAccountKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientListStorageAccountKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientListStorageAccountKeysResponse{}, err } - return client.listStorageAccountKeysHandleResponse(resp) + resp, err := client.listStorageAccountKeysHandleResponse(httpResp) + return resp, err } // listStorageAccountKeysCreateRequest creates the ListStorageAccountKeys request. @@ -708,7 +789,7 @@ func (client *WorkspacesClient) listStorageAccountKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -723,12 +804,12 @@ func (client *WorkspacesClient) listStorageAccountKeysHandleResponse(resp *http. return result, nil } -// BeginPrepareNotebook - Prepare a notebook. +// BeginPrepareNotebook - Prepare Azure Machine Learning Workspace's notebook resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientBeginPrepareNotebookOptions contains the optional parameters for the WorkspacesClient.BeginPrepareNotebook // method. func (client *WorkspacesClient) BeginPrepareNotebook(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginPrepareNotebookOptions) (*runtime.Poller[WorkspacesClientPrepareNotebookResponse], error) { @@ -737,31 +818,41 @@ func (client *WorkspacesClient) BeginPrepareNotebook(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientPrepareNotebookResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientPrepareNotebookResponse]{ FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[WorkspacesClientPrepareNotebookResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientPrepareNotebookResponse]{ + Tracer: client.internal.Tracer(), + }) } } -// PrepareNotebook - Prepare a notebook. +// PrepareNotebook - Prepare Azure Machine Learning Workspace's notebook resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *WorkspacesClient) prepareNotebook(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginPrepareNotebookOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginPrepareNotebook" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.prepareNotebookCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // prepareNotebookCreateRequest creates the PrepareNotebook request. @@ -784,19 +875,19 @@ func (client *WorkspacesClient) prepareNotebookCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// BeginResyncKeys - Resync all the keys associated with this workspace. This includes keys for the storage account, app insights +// BeginResyncKeys - Resync all the keys associated with this workspace.This includes keys for the storage account, app insights // and password for container registry // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name // - options - WorkspacesClientBeginResyncKeysOptions contains the optional parameters for the WorkspacesClient.BeginResyncKeys // method. func (client *WorkspacesClient) BeginResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginResyncKeysOptions) (*runtime.Poller[WorkspacesClientResyncKeysResponse], error) { @@ -805,30 +896,42 @@ func (client *WorkspacesClient) BeginResyncKeys(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientResyncKeysResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientResyncKeysResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[WorkspacesClientResyncKeysResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientResyncKeysResponse]{ + Tracer: client.internal.Tracer(), + }) } } -// ResyncKeys - Resync all the keys associated with this workspace. This includes keys for the storage account, app insights +// ResyncKeys - Resync all the keys associated with this workspace.This includes keys for the storage account, app insights // and password for container registry // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview func (client *WorkspacesClient) resyncKeys(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginResyncKeysOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginResyncKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() req, err := client.resyncKeysCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resyncKeysCreateRequest creates the ResyncKeys request. @@ -851,7 +954,7 @@ func (client *WorkspacesClient) resyncKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -860,44 +963,55 @@ func (client *WorkspacesClient) resyncKeysCreateRequest(ctx context.Context, res // BeginUpdate - Updates a machine learning workspace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. -// - workspaceName - Name of Azure Machine Learning workspace. -// - parameters - The parameters for updating a machine learning workspace. +// - workspaceName - Azure Machine Learning Workspace Name +// - body - The parameters for updating a machine learning workspace. // - options - WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. -func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*runtime.Poller[WorkspacesClientUpdateResponse], error) { +func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*runtime.Poller[WorkspacesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, workspaceName, parameters, options) + resp, err := client.update(ctx, resourceGroupName, workspaceName, body, options) if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[WorkspacesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) } } // Update - Updates a machine learning workspace with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 -func (client *WorkspacesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, parameters, options) +// Generated from API version 2024-01-01-preview +func (client *WorkspacesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. -func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -916,8 +1030,11 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client_example_test.go b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client_example_test.go deleted file mode 100644 index 59167ae0b3e4..000000000000 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client_example_test.go +++ /dev/null @@ -1,683 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armmachinelearning_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/get.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "workspace-1234", "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armmachinelearning.Workspace{ - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace"), - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("test description"), - // AllowPublicAccessWhenBehindVnet: to.Ptr(false), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"), - // DiscoveryURL: to.Ptr("http://example.com"), - // Encryption: &armmachinelearning.EncryptionProperty{ - // Identity: &armmachinelearning.IdentityForCmk{ - // UserAssignedIdentity: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai"), - // }, - // KeyVaultProperties: &armmachinelearning.EncryptionKeyVaultProperties{ - // IdentityClientID: to.Ptr(""), - // KeyIdentifier: to.Ptr("https://testkv.vault.azure.net/keys/testkey/aabbccddee112233445566778899aabb"), - // KeyVaultArmID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // }, - // Status: to.Ptr(armmachinelearning.EncryptionStatusEnabled), - // }, - // FriendlyName: to.Ptr("HelloName"), - // HbiWorkspace: to.Ptr(false), - // ImageBuildCompute: to.Ptr("testcompute"), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // PrivateEndpointConnections: []*armmachinelearning.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testprivatelinkconnection"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace/privateEndpointConnections/testprivatelinkconnection"), - // Properties: &armmachinelearning.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armmachinelearning.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rg-1234/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armmachinelearning.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armmachinelearning.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // PrivateLinkCount: to.Ptr[int32](0), - // PublicNetworkAccess: to.Ptr(armmachinelearning.PublicNetworkAccessDisabled), - // ServiceProvisionedResourceGroup: to.Ptr("testworkspace_0000111122223333"), - // SharedPrivateLinkResources: []*armmachinelearning.SharedPrivateLinkResource{ - // { - // Name: to.Ptr("testcosmosdbresource"), - // Properties: &armmachinelearning.SharedPrivateLinkResourceProperty{ - // GroupID: to.Ptr("Sql"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testcosmosdbresource/privateLinkResources/Sql"), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }}, - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/create.json -func ExampleWorkspacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "workspace-1234", "testworkspace", armmachinelearning.Workspace{ - Identity: &armmachinelearning.ManagedServiceIdentity{ - Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai": {}, - }, - }, - Location: to.Ptr("eastus2euap"), - Properties: &armmachinelearning.WorkspaceProperties{ - Description: to.Ptr("test description"), - ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"), - Encryption: &armmachinelearning.EncryptionProperty{ - Identity: &armmachinelearning.IdentityForCmk{ - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai"), - }, - KeyVaultProperties: &armmachinelearning.EncryptionKeyVaultProperties{ - IdentityClientID: to.Ptr(""), - KeyIdentifier: to.Ptr("https://testkv.vault.azure.net/keys/testkey/aabbccddee112233445566778899aabb"), - KeyVaultArmID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - }, - Status: to.Ptr(armmachinelearning.EncryptionStatusEnabled), - }, - FriendlyName: to.Ptr("HelloName"), - HbiWorkspace: to.Ptr(false), - KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - SharedPrivateLinkResources: []*armmachinelearning.SharedPrivateLinkResource{ - { - Name: to.Ptr("testdbresource"), - Properties: &armmachinelearning.SharedPrivateLinkResourceProperty{ - GroupID: to.Ptr("Sql"), - PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql"), - RequestMessage: to.Ptr("Please approve"), - Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - }, - }}, - StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armmachinelearning.Workspace{ - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace"), - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // UserAssignedIdentities: map[string]*armmachinelearning.UserAssignedIdentity{ - // "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai": &armmachinelearning.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // }, - // }, - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("test description"), - // AllowPublicAccessWhenBehindVnet: to.Ptr(false), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"), - // DiscoveryURL: to.Ptr("http://example.com"), - // Encryption: &armmachinelearning.EncryptionProperty{ - // Identity: &armmachinelearning.IdentityForCmk{ - // UserAssignedIdentity: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testuai"), - // }, - // KeyVaultProperties: &armmachinelearning.EncryptionKeyVaultProperties{ - // IdentityClientID: to.Ptr(""), - // KeyIdentifier: to.Ptr("https://testkv.vault.azure.net/keys/testkey/aabbccddee112233445566778899aabb"), - // KeyVaultArmID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // }, - // Status: to.Ptr(armmachinelearning.EncryptionStatusEnabled), - // }, - // FriendlyName: to.Ptr("HelloName"), - // HbiWorkspace: to.Ptr(false), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // PublicNetworkAccess: to.Ptr(armmachinelearning.PublicNetworkAccessDisabled), - // SharedPrivateLinkResources: []*armmachinelearning.SharedPrivateLinkResource{ - // { - // Name: to.Ptr("testdbresource"), - // Properties: &armmachinelearning.SharedPrivateLinkResourceProperty{ - // GroupID: to.Ptr("Sql"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkResources/Sql"), - // RequestMessage: to.Ptr("Please approve"), - // Status: to.Ptr(armmachinelearning.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }}, - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/delete.json -func ExampleWorkspacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginDelete(ctx, "workspace-1234", "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/update.json -func ExampleWorkspacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginUpdate(ctx, "workspace-1234", "testworkspace", armmachinelearning.WorkspaceUpdateParameters{ - Properties: &armmachinelearning.WorkspacePropertiesUpdateParameters{ - Description: to.Ptr("new description"), - FriendlyName: to.Ptr("New friendly name"), - PublicNetworkAccess: to.Ptr(armmachinelearning.PublicNetworkAccessDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armmachinelearning.Workspace{ - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace"), - // Identity: &armmachinelearning.ManagedServiceIdentity{ - // Type: to.Ptr(armmachinelearning.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // TenantID: to.Ptr("00000000-1111-2222-3333-444444444444"), - // }, - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("new description"), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"), - // DiscoveryURL: to.Ptr("http://example.com"), - // FriendlyName: to.Ptr("New friendly name"), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // PublicNetworkAccess: to.Ptr(armmachinelearning.PublicNetworkAccessDisabled), - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listByResourceGroup.json -func ExampleWorkspacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListByResourceGroupPager("workspace-1234", &armmachinelearning.WorkspacesClientListByResourceGroupOptions{Skip: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListResult = armmachinelearning.WorkspaceListResult{ - // Value: []*armmachinelearning.Workspace{ - // { - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("test description"), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"), - // DiscoveryURL: to.Ptr("http://example.com"), - // FriendlyName: to.Ptr("HelloName"), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), - // }, - // }, - // { - // Name: to.Ptr("testworkspace1"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace1"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("test description"), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistryNew"), - // DiscoveryURL: to.Ptr("http://example.com"), - // FriendlyName: to.Ptr("HelloName 1"), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkvNew"), - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccountOld"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/diagnose.json -func ExampleWorkspacesClient_BeginDiagnose() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginDiagnose(ctx, "workspace-1234", "testworkspace", &armmachinelearning.WorkspacesClientBeginDiagnoseOptions{Parameters: &armmachinelearning.DiagnoseWorkspaceParameters{ - Value: &armmachinelearning.DiagnoseRequestProperties{ - ApplicationInsights: map[string]any{}, - ContainerRegistry: map[string]any{}, - DNSResolution: map[string]any{}, - KeyVault: map[string]any{}, - Nsg: map[string]any{}, - Others: map[string]any{}, - ResourceLock: map[string]any{}, - StorageAccount: map[string]any{}, - Udr: map[string]any{}, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiagnoseResponseResult = armmachinelearning.DiagnoseResponseResult{ - // Value: &armmachinelearning.DiagnoseResponseResultValue{ - // ApplicationInsightsResults: []*armmachinelearning.DiagnoseResult{ - // }, - // ContainerRegistryResults: []*armmachinelearning.DiagnoseResult{ - // }, - // DNSResolutionResults: []*armmachinelearning.DiagnoseResult{ - // { - // Code: to.Ptr("CustomDNSInUse"), - // Level: to.Ptr(armmachinelearning.DiagnoseResultLevelWarning), - // Message: to.Ptr("We have detected an on-premise dns server is configured. Please make sure conditional forwarding is configured correctly according to doc https://foo"), - // }}, - // KeyVaultResults: []*armmachinelearning.DiagnoseResult{ - // }, - // NetworkSecurityRuleResults: []*armmachinelearning.DiagnoseResult{ - // }, - // OtherResults: []*armmachinelearning.DiagnoseResult{ - // }, - // ResourceLockResults: []*armmachinelearning.DiagnoseResult{ - // }, - // StorageAccountResults: []*armmachinelearning.DiagnoseResult{ - // }, - // UserDefinedRouteResults: []*armmachinelearning.DiagnoseResult{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listKeys.json -func ExampleWorkspacesClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().ListKeys(ctx, "testrg123", "workspaces123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListWorkspaceKeysResult = armmachinelearning.ListWorkspaceKeysResult{ - // ContainerRegistryCredentials: &armmachinelearning.RegistryListCredentialsResult{ - // Passwords: []*armmachinelearning.Password{ - // { - // Name: to.Ptr("password"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("password2"), - // Value: to.Ptr("0KARRQoQHSUq1yViPWg7YFernOS=Ic/t"), - // }}, - // Username: to.Ptr("testdemoworkjmjmeykp"), - // }, - // NotebookAccessKeys: &armmachinelearning.ListNotebookKeysResult{ - // }, - // UserStorageResourceID: to.Ptr("/subscriptions/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/resourceGroups/ragargeastus2euap/providers/Microsoft.Storage/storageAccounts/testdemoworkazashomr"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/resyncKeys.json -func ExampleWorkspacesClient_BeginResyncKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginResyncKeys(ctx, "testrg123", "workspaces123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listBySubscription.json -func ExampleWorkspacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListBySubscriptionPager(&armmachinelearning.WorkspacesClientListBySubscriptionOptions{Skip: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListResult = armmachinelearning.WorkspaceListResult{ - // Value: []*armmachinelearning.Workspace{ - // { - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.MachineLearningServices/workspaces/testworkspace"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("test description"), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry"), - // DiscoveryURL: to.Ptr("http://example.com"), - // FriendlyName: to.Ptr("HelloName"), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkv"), - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccount"), - // }, - // }, - // { - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.MachineLearningServices/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-5678/providers/Microsoft.MachineLearningServices/workspaces/testworkspace"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armmachinelearning.WorkspaceProperties{ - // Description: to.Ptr("test description"), - // ApplicationInsights: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/microsoft.insights/components/testinsights"), - // ContainerRegistry: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistryNew"), - // DiscoveryURL: to.Ptr("http://example.com"), - // FriendlyName: to.Ptr("HelloName"), - // KeyVault: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/testkvNew"), - // StorageAccount: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testStorageAccountOld"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listNotebookAccessToken.json -func ExampleWorkspacesClient_ListNotebookAccessToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().ListNotebookAccessToken(ctx, "workspace-1234", "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NotebookAccessTokenResult = armmachinelearning.NotebookAccessTokenResult{ - // ExpiresIn: to.Ptr[int32](28800), - // HostName: to.Ptr("Host product name"), - // NotebookResourceID: to.Ptr("94350843095843059"), - // PublicDNS: to.Ptr("resource.notebooks.azure.net"), - // Scope: to.Ptr("aznb_identity"), - // TokenType: to.Ptr("Bearer"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/prepare.json -func ExampleWorkspacesClient_BeginPrepareNotebook() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginPrepareNotebook(ctx, "testrg123", "workspaces123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NotebookResourceInfo = armmachinelearning.NotebookResourceInfo{ - // Fqdn: to.Ptr("testnotebook.notebooks.azure.com"), - // NotebookPreparationError: &armmachinelearning.NotebookPreparationError{ - // ErrorMessage: to.Ptr("general error"), - // StatusCode: to.Ptr[int32](500), - // }, - // ResourceID: to.Ptr("aabbccddee112233445566778899"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Workspace/listStorageAccountKeys.json -func ExampleWorkspacesClient_ListStorageAccountKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().ListStorageAccountKeys(ctx, "testrg123", "workspaces123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListStorageAccountKeysResult = armmachinelearning.ListStorageAccountKeysResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/Notebook/listKeys.json -func ExampleWorkspacesClient_ListNotebookKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().ListNotebookKeys(ctx, "testrg123", "workspaces123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ListNotebookKeysResult = armmachinelearning.ListNotebookKeysResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/aafb0944f7ab936e8cfbad8969bd5eb32263fb4f/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2022-10-01/examples/ExternalFQDN/get.json -func ExampleWorkspacesClient_ListOutboundNetworkDependenciesEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmachinelearning.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().ListOutboundNetworkDependenciesEndpoints(ctx, "workspace-1234", "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExternalFQDNResponse = armmachinelearning.ExternalFQDNResponse{ - // Value: []*armmachinelearning.FQDNEndpoints{ - // { - // Properties: &armmachinelearning.FQDNEndpointsProperties{ - // Category: to.Ptr("Azure Active Directory"), - // Endpoints: []*armmachinelearning.FQDNEndpoint{ - // { - // DomainName: to.Ptr("login.microsoftonline.com"), - // EndpointDetails: []*armmachinelearning.FQDNEndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // }, - // { - // Properties: &armmachinelearning.FQDNEndpointsProperties{ - // Category: to.Ptr("Azure portal"), - // Endpoints: []*armmachinelearning.FQDNEndpoint{ - // { - // DomainName: to.Ptr("management.azure.com"), - // EndpointDetails: []*armmachinelearning.FQDNEndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // }}, - // } -}