From a06d6038f487b86ca8a9f208cd102a471ee5970b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 20 Jun 2024 16:47:45 +0000 Subject: [PATCH] CodeGen from PR 29519 in Azure/azure-rest-api-specs Merge 993c47975d4e3fe9ed8c863bf764461179df2463 into cc5177f9635085107f59f74190bf47ebbded2923 --- .../armmachinelearning/CHANGELOG.md | 462 + .../armmachinelearning/README.md | 6 +- .../armmachinelearning/autorest.md | 6 +- .../batchdeployments_client.go | 38 +- .../batchdeployments_client_example_test.go | 495 - .../batchendpoints_client.go | 42 +- .../batchendpoints_client_example_test.go | 387 - .../armmachinelearning/client_factory.go | 338 +- .../codecontainers_client.go | 16 +- .../codecontainers_client_example_test.go | 192 - .../armmachinelearning/codeversions_client.go | 196 +- .../codeversions_client_example_test.go | 191 - .../componentcontainers_client.go | 16 +- ...componentcontainers_client_example_test.go | 182 - .../componentversions_client.go | 113 +- .../componentversions_client_example_test.go | 200 - .../armmachinelearning/compute_client.go | 52 +- .../compute_client_example_test.go | 1001 -- .../armmachinelearning/constants.go | 1264 +- .../datacontainers_client.go | 16 +- .../datacontainers_client_example_test.go | 219 - .../armmachinelearning/datastores_client.go | 32 +- .../datastores_client_example_test.go | 449 - .../armmachinelearning/dataversions_client.go | 113 +- .../dataversions_client_example_test.go | 197 - .../environmentcontainers_client.go | 16 +- ...vironmentcontainers_client_example_test.go | 186 - .../environmentversions_client.go | 113 +- ...environmentversions_client_example_test.go | 271 - .../fake/batchdeployments_server.go | 2 +- .../fake/batchendpoints_server.go | 2 +- .../fake/codecontainers_server.go | 2 +- .../fake/codeversions_server.go | 137 +- .../fake/componentcontainers_server.go | 2 +- .../fake/componentversions_server.go | 66 +- .../armmachinelearning/fake/compute_server.go | 2 +- .../fake/datacontainers_server.go | 2 +- .../fake/datastores_server.go | 15 +- .../fake/dataversions_server.go | 66 +- .../fake/environmentcontainers_server.go | 2 +- .../fake/environmentversions_server.go | 66 +- .../fake/features_server.go | 224 + .../fake/featuresetcontainers_server.go | 330 + .../fake/featuresetversions_server.go | 422 + .../featurestoreentitycontainers_server.go | 330 + .../fake/featurestoreentityversions_server.go | 358 + .../armmachinelearning/fake/jobs_server.go | 10 +- .../fake/managednetworkprovisions_server.go | 126 + .../fake/managednetworksettingsrule_server.go | 272 + .../fake/marketplacesubscriptions_server.go | 284 + .../fake/modelcontainers_server.go | 2 +- .../fake/modelversions_server.go | 66 +- .../fake/onlinedeployments_server.go | 2 +- .../fake/onlineendpoints_server.go | 2 +- .../fake/operations_server.go | 2 +- .../fake/privateendpointconnections_server.go | 2 +- .../fake/privatelinkresources_server.go | 2 +- .../armmachinelearning/fake/quotas_server.go | 2 +- .../fake/registries_server.go | 396 + .../fake/registrycodecontainers_server.go | 284 + .../fake/registrycodeversions_server.go | 373 + .../registrycomponentcontainers_server.go | 284 + .../fake/registrycomponentversions_server.go | 322 + .../fake/registrydatacontainers_server.go | 290 + .../fake/registrydatareferences_server.go | 112 + .../fake/registrydataversions_server.go | 385 + .../registryenvironmentcontainers_server.go | 290 + .../registryenvironmentversions_server.go | 328 + .../fake/registrymodelcontainers_server.go | 290 + .../fake/registrymodelversions_server.go | 403 + .../fake/schedules_server.go | 2 +- .../armmachinelearning/fake/server_factory.go | 255 +- .../fake/serverlessendpoints_server.go | 447 + .../armmachinelearning/fake/time_rfc3339.go | 42 +- .../armmachinelearning/fake/usages_server.go | 2 +- .../fake/virtualmachinesizes_server.go | 2 +- .../fake/workspaceconnections_server.go | 45 +- .../fake/workspacefeatures_server.go | 2 +- .../fake/workspaces_server.go | 20 +- .../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 | 14 +- .../machinelearning/armmachinelearning/go.sum | 17 - .../armmachinelearning/interfaces.go | 159 +- .../armmachinelearning/jobs_client.go | 39 +- .../jobs_client_example_test.go | 1500 -- .../managednetworkprovisions_client.go | 127 + .../managednetworksettingsrule_client.go | 346 + .../marketplacesubscriptions_client.go | 350 + .../modelcontainers_client.go | 16 +- .../modelcontainers_client_example_test.go | 175 - .../armmachinelearning/models.go | 3575 +++- .../armmachinelearning/models_serde.go | 14463 +++++++++++----- .../modelversions_client.go | 133 +- .../modelversions_client_example_test.go | 230 - .../onlinedeployments_client.go | 52 +- .../onlinedeployments_client_example_test.go | 1017 -- .../onlineendpoints_client.go | 70 +- .../onlineendpoints_client_example_test.go | 449 - .../armmachinelearning/operations_client.go | 6 +- .../operations_client_example_test.go | 70 - .../armmachinelearning/options.go | 839 +- .../armmachinelearning/polymorphic_helpers.go | 598 +- .../privateendpointconnections_client.go | 16 +- ...endpointconnections_client_example_test.go | 175 - .../privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 51 - .../armmachinelearning/quotas_client.go | 8 +- .../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 | 377 + .../registrydatacontainers_client.go | 353 + .../registrydatareferences_client.go | 123 + .../registrydataversions_client.go | 462 + .../registryenvironmentcontainers_client.go | 353 + .../registryenvironmentversions_client.go | 380 + .../registrymodelcontainers_client.go | 353 + .../registrymodelversions_client.go | 471 + .../{response_types.go => responses.go} | 527 +- .../armmachinelearning/schedules_client.go | 26 +- .../schedules_client_example_test.go | 253 - .../serverlessendpoints_client.go | 590 + .../armmachinelearning/time_rfc3339.go | 42 +- .../armmachinelearning/usages_client.go | 4 +- .../usages_client_example_test.go | 431 - .../virtualmachinesizes_client.go | 4 +- ...virtualmachinesizes_client_example_test.go | 396 - .../workspaceconnections_client.go | 90 +- ...orkspaceconnections_client_example_test.go | 152 - .../workspacefeatures_client.go | 4 +- .../workspacefeatures_client_example_test.go | 56 - .../armmachinelearning/workspaces_client.go | 72 +- .../workspaces_client_example_test.go | 683 - 139 files changed, 34045 insertions(+), 14855 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 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/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/managednetworkprovisions_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/managednetworksettingsrule_server.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/fake/marketplacesubscriptions_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/serverlessendpoints_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 delete mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client_example_test.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/managednetworkprovisions_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/managednetworksettingsrule_client.go create mode 100644 sdk/resourcemanager/machinelearning/armmachinelearning/marketplacesubscriptions_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 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 rename sdk/resourcemanager/machinelearning/armmachinelearning/{response_types.go => responses.go} (53%) 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 01fdecafb0f8..57964508081e 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/CHANGELOG.md @@ -1,5 +1,467 @@ # Release History +## 4.0.0-beta.1 (2024-06-20) +### Breaking Changes + +- 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` +- Struct `AmlOperation` has been removed +- Struct `AmlOperationDisplay` has been removed +- Struct `AmlOperationListResult` has been removed +- Field `AmlOperationListResult` of struct `OperationsClientListResponse` has been removed +- Field `SubnetArmID` of struct `PrivateEndpoint` has been removed + +### Features Added + +- New value `ConnectionAuthTypeAAD`, `ConnectionAuthTypeAPIKey`, `ConnectionAuthTypeAccessKey`, `ConnectionAuthTypeAccountKey`, `ConnectionAuthTypeCustomKeys`, `ConnectionAuthTypeOAuth2`, `ConnectionAuthTypeServicePrincipal` added to enum type `ConnectionAuthType` +- New value `ConnectionCategoryADLSGen2`, `ConnectionCategoryAIServices`, `ConnectionCategoryAPIKey`, `ConnectionCategoryAmazonMws`, `ConnectionCategoryAmazonRdsForOracle`, `ConnectionCategoryAmazonRdsForSQLServer`, `ConnectionCategoryAmazonRedshift`, `ConnectionCategoryAmazonS3Compatible`, `ConnectionCategoryAzureBlob`, `ConnectionCategoryAzureDataExplorer`, `ConnectionCategoryAzureDatabricksDeltaLake`, `ConnectionCategoryAzureMariaDb`, `ConnectionCategoryAzureMySQLDb`, `ConnectionCategoryAzureOneLake`, `ConnectionCategoryAzureOpenAI`, `ConnectionCategoryAzurePostgresDb`, `ConnectionCategoryAzureSQLDb`, `ConnectionCategoryAzureSQLMi`, `ConnectionCategoryAzureSynapseAnalytics`, `ConnectionCategoryAzureTableStorage`, `ConnectionCategoryBingLLMSearch`, `ConnectionCategoryCassandra`, `ConnectionCategoryCognitiveSearch`, `ConnectionCategoryCognitiveService`, `ConnectionCategoryConcur`, `ConnectionCategoryCosmosDb`, `ConnectionCategoryCosmosDbMongoDbAPI`, `ConnectionCategoryCouchbase`, `ConnectionCategoryCustomKeys`, `ConnectionCategoryDb2`, `ConnectionCategoryDrill`, `ConnectionCategoryDynamics`, `ConnectionCategoryDynamicsAx`, `ConnectionCategoryDynamicsCrm`, `ConnectionCategoryEloqua`, `ConnectionCategoryFileServer`, `ConnectionCategoryFtpServer`, `ConnectionCategoryGenericContainerRegistry`, `ConnectionCategoryGenericHTTP`, `ConnectionCategoryGenericRest`, `ConnectionCategoryGoogleAdWords`, `ConnectionCategoryGoogleBigQuery`, `ConnectionCategoryGoogleCloudStorage`, `ConnectionCategoryGreenplum`, `ConnectionCategoryHbase`, `ConnectionCategoryHdfs`, `ConnectionCategoryHive`, `ConnectionCategoryHubspot`, `ConnectionCategoryImpala`, `ConnectionCategoryInformix`, `ConnectionCategoryJira`, `ConnectionCategoryMagento`, `ConnectionCategoryMariaDb`, `ConnectionCategoryMarketo`, `ConnectionCategoryMicrosoftAccess`, `ConnectionCategoryMongoDbAtlas`, `ConnectionCategoryMongoDbV2`, `ConnectionCategoryMySQL`, `ConnectionCategoryNetezza`, `ConnectionCategoryODataRest`, `ConnectionCategoryOdbc`, `ConnectionCategoryOffice365`, `ConnectionCategoryOpenAI`, `ConnectionCategoryOracle`, `ConnectionCategoryOracleCloudStorage`, `ConnectionCategoryOracleServiceCloud`, `ConnectionCategoryPayPal`, `ConnectionCategoryPhoenix`, `ConnectionCategoryPostgreSQL`, `ConnectionCategoryPresto`, `ConnectionCategoryQuickBooks`, `ConnectionCategoryRedis`, `ConnectionCategoryResponsys`, `ConnectionCategoryS3`, `ConnectionCategorySQLServer`, `ConnectionCategorySalesforce`, `ConnectionCategorySalesforceMarketingCloud`, `ConnectionCategorySalesforceServiceCloud`, `ConnectionCategorySapBw`, `ConnectionCategorySapCloudForCustomer`, `ConnectionCategorySapEcc`, `ConnectionCategorySapHana`, `ConnectionCategorySapOpenHub`, `ConnectionCategorySapTable`, `ConnectionCategorySerp`, `ConnectionCategoryServerless`, `ConnectionCategoryServiceNow`, `ConnectionCategorySftp`, `ConnectionCategorySharePointOnlineList`, `ConnectionCategoryShopify`, `ConnectionCategorySnowflake`, `ConnectionCategorySpark`, `ConnectionCategorySquare`, `ConnectionCategorySybase`, `ConnectionCategoryTeradata`, `ConnectionCategoryVertica`, `ConnectionCategoryWebTable`, `ConnectionCategoryXero`, `ConnectionCategoryZoho` added to enum type `ConnectionCategory` +- New value `DatastoreTypeOneLake` added to enum type `DatastoreType` +- New value `JobTypeSpark` added to enum type `JobType` +- New value `OutputDeliveryModeDirect` added to enum type `OutputDeliveryMode` +- New value `ScheduleActionTypeCreateMonitor` added to enum type `ScheduleActionType` +- New enum type `ActionType` with values `ActionTypeInternal` +- New enum type `AssetProvisioningState` with values `AssetProvisioningStateCanceled`, `AssetProvisioningStateCreating`, `AssetProvisioningStateDeleting`, `AssetProvisioningStateFailed`, `AssetProvisioningStateSucceeded`, `AssetProvisioningStateUpdating` +- 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 `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 `ConnectionGroup` with values `ConnectionGroupAzure`, `ConnectionGroupAzureAI`, `ConnectionGroupDatabase`, `ConnectionGroupFile`, `ConnectionGroupGenericProtocol`, `ConnectionGroupNoSQL`, `ConnectionGroupServicesAndApps` +- New enum type `ContentSafetyStatus` with values `ContentSafetyStatusDisabled`, `ContentSafetyStatusEnabled` +- New enum type `DataAvailabilityStatus` with values `DataAvailabilityStatusComplete`, `DataAvailabilityStatusIncomplete`, `DataAvailabilityStatusNone`, `DataAvailabilityStatusPending` +- New enum type `DataCollectionMode` with values `DataCollectionModeDisabled`, `DataCollectionModeEnabled` +- 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` +- New enum type `EnvironmentVariableType` with values `EnvironmentVariableTypeLocal` +- 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 `ImageType` with values `ImageTypeAzureml`, `ImageTypeDocker` +- New enum type `IsolationMode` with values `IsolationModeAllowInternetOutbound`, `IsolationModeAllowOnlyApprovedOutbound`, `IsolationModeDisabled` +- New enum type `JobTier` with values `JobTierBasic`, `JobTierNull`, `JobTierPremium`, `JobTierSpot`, `JobTierStandard` +- New enum type `ManagedNetworkStatus` with values `ManagedNetworkStatusActive`, `ManagedNetworkStatusInactive` +- New enum type `MarketplaceSubscriptionProvisioningState` with values `MarketplaceSubscriptionProvisioningStateCanceled`, `MarketplaceSubscriptionProvisioningStateCreating`, `MarketplaceSubscriptionProvisioningStateDeleting`, `MarketplaceSubscriptionProvisioningStateFailed`, `MarketplaceSubscriptionProvisioningStateSucceeded`, `MarketplaceSubscriptionProvisioningStateUpdating` +- New enum type `MarketplaceSubscriptionStatus` with values `MarketplaceSubscriptionStatusSubscribed`, `MarketplaceSubscriptionStatusSuspended`, `MarketplaceSubscriptionStatusUnsubscribed` +- New enum type `MaterializationStoreType` with values `MaterializationStoreTypeNone`, `MaterializationStoreTypeOffline`, `MaterializationStoreTypeOnline`, `MaterializationStoreTypeOnlineAndOffline` +- New enum type `ModelTaskType` with values `ModelTaskTypeClassification`, `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 `MonitoringNotificationType` with values `MonitoringNotificationTypeAmlNotification` +- New enum type `MonitoringSignalType` with values `MonitoringSignalTypeCustom`, `MonitoringSignalTypeDataDrift`, `MonitoringSignalTypeDataQuality`, `MonitoringSignalTypeFeatureAttributionDrift`, `MonitoringSignalTypePredictionDrift` +- New enum type `NodesValueType` with values `NodesValueTypeAll` +- 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 `PendingUploadCredentialType` with values `PendingUploadCredentialTypeSAS` +- New enum type `PendingUploadType` with values `PendingUploadTypeNone`, `PendingUploadTypeTemporaryBlobReference` +- New enum type `Protocol` with values `ProtocolHTTP`, `ProtocolTCP`, `ProtocolUDP` +- 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 `RuleCategoryDependency`, `RuleCategoryRecommended`, `RuleCategoryRequired`, `RuleCategoryUserDefined` +- New enum type `RuleStatus` with values `RuleStatusActive`, `RuleStatusInactive` +- New enum type `RuleType` with values `RuleTypeFQDN`, `RuleTypePrivateEndpoint`, `RuleTypeServiceTag` +- New enum type `ServerlessEndpointState` with values `ServerlessEndpointStateCreating`, `ServerlessEndpointStateCreationFailed`, `ServerlessEndpointStateDeleting`, `ServerlessEndpointStateDeletionFailed`, `ServerlessEndpointStateOnline`, `ServerlessEndpointStateReinstating`, `ServerlessEndpointStateSuspended`, `ServerlessEndpointStateSuspending`, `ServerlessEndpointStateUnknown` +- New enum type `ServerlessInferenceEndpointAuthMode` with values `ServerlessInferenceEndpointAuthModeKey` +- New enum type `SparkJobEntryType` with values `SparkJobEntryTypeSparkJobPythonEntry`, `SparkJobEntryTypeSparkJobScalaEntry` +- New enum type `VolumeDefinitionType` with values `VolumeDefinitionTypeBind`, `VolumeDefinitionTypeNpipe`, `VolumeDefinitionTypeTmpfs`, `VolumeDefinitionTypeVolume` +- New enum type `WebhookType` with values `WebhookTypeAzureDevOps` +- New function `*AADAuthTypeWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*APIKeyAuthWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*AccessKeyAuthTypeWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*AccountKeyAuthTypeWorkspaceConnectionProperties.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 `*BatchDeploymentConfiguration.GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration` +- New function `*BatchPipelineComponentDeploymentConfiguration.GetBatchDeploymentConfiguration() *BatchDeploymentConfiguration` +- New function `*CategoricalDataDriftMetricThreshold.GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase` +- New function `*CategoricalDataQualityMetricThreshold.GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase` +- New function `*CategoricalPredictionDriftMetricThreshold.GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase` +- 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.NewManagedNetworkProvisionsClient() *ManagedNetworkProvisionsClient` +- New function `*ClientFactory.NewManagedNetworkSettingsRuleClient() *ManagedNetworkSettingsRuleClient` +- New function `*ClientFactory.NewMarketplaceSubscriptionsClient() *MarketplaceSubscriptionsClient` +- 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 `*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 `*CreateMonitorAction.GetScheduleActionBase() *ScheduleActionBase` +- New function `*CustomKeysWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*CustomMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*DataDriftMetricThresholdBase.GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase` +- New function `*DataDriftMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- 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 `*DockerCredential.GetDataReferenceCredential() *DataReferenceCredential` +- New function `*EnvironmentVersionsClient.BeginPublish(context.Context, string, string, string, string, DestinationAsset, *EnvironmentVersionsClientBeginPublishOptions) (*runtime.Poller[EnvironmentVersionsClientPublishResponse], error)` +- 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 `*FixedInputData.GetMonitoringInputDataBase() *MonitoringInputDataBase` +- New function `*FqdnOutboundRule.GetOutboundRule() *OutboundRule` +- New function `*LakeHouseArtifact.GetOneLakeArtifact() *OneLakeArtifact` +- 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 `NewMarketplaceSubscriptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MarketplaceSubscriptionsClient, error)` +- New function `*MarketplaceSubscriptionsClient.BeginCreateOrUpdate(context.Context, string, string, string, MarketplaceSubscription, *MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[MarketplaceSubscriptionsClientCreateOrUpdateResponse], error)` +- New function `*MarketplaceSubscriptionsClient.BeginDelete(context.Context, string, string, string, *MarketplaceSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[MarketplaceSubscriptionsClientDeleteResponse], error)` +- New function `*MarketplaceSubscriptionsClient.Get(context.Context, string, string, string, *MarketplaceSubscriptionsClientGetOptions) (MarketplaceSubscriptionsClientGetResponse, error)` +- New function `*MarketplaceSubscriptionsClient.NewListPager(string, string, *MarketplaceSubscriptionsClientListOptions) *runtime.Pager[MarketplaceSubscriptionsClientListResponse]` +- 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 `*OAuth2AuthTypeWorkspaceConnectionProperties.GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2` +- New function `*OneLakeArtifact.GetOneLakeArtifact() *OneLakeArtifact` +- New function `*OneLakeDatastore.GetDatastoreProperties() *DatastoreProperties` +- New function `*OutboundRule.GetOutboundRule() *OutboundRule` +- New function `*PendingUploadCredentialDto.GetPendingUploadCredentialDto() *PendingUploadCredentialDto` +- New function `*PredictionDriftMetricThresholdBase.GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase` +- New function `*PredictionDriftMonitoringSignal.GetMonitoringSignalBase() *MonitoringSignalBase` +- New function `*PrivateEndpointOutboundRule.GetOutboundRule() *OutboundRule` +- 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 `*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.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 `*Webhook.GetWebhook() *Webhook` +- New function `*WorkspaceConnectionsClient.ListSecrets(context.Context, string, string, string, *WorkspaceConnectionsClientListSecretsOptions) (WorkspaceConnectionsClientListSecretsResponse, error)` +- New function `*Nodes.GetNodes() *Nodes` +- New function `*NumericalDataDriftMetricThreshold.GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase` +- New function `*NumericalDataQualityMetricThreshold.GetDataQualityMetricThresholdBase() *DataQualityMetricThresholdBase` +- New function `*NumericalPredictionDriftMetricThreshold.GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase` +- New struct `AADAuthTypeWorkspaceConnectionProperties` +- New struct `APIKeyAuthWorkspaceConnectionProperties` +- New struct `AccessKeyAuthTypeWorkspaceConnectionProperties` +- New struct `AccountKeyAuthTypeWorkspaceConnectionProperties` +- New struct `AcrDetails` +- New struct `AllFeatures` +- New struct `AllNodes` +- New struct `AmlTokenComputeIdentity` +- New struct `AnonymousAccessCredential` +- New struct `ArmResourceID` +- New struct `AzureDatastore` +- New struct `AzureDevOpsWebhook` +- New struct `BatchPipelineComponentDeploymentConfiguration` +- New struct `BindOptions` +- New struct `BlobReferenceForConsumptionDto` +- New struct `CategoricalDataDriftMetricThreshold` +- New struct `CategoricalDataQualityMetricThreshold` +- New struct `CategoricalPredictionDriftMetricThreshold` +- New struct `Collection` +- New struct `ComputeRecurrenceSchedule` +- New struct `ComputeRuntimeDto` +- New struct `ContentSafety` +- New struct `CreateMonitorAction` +- New struct `Cron` +- New struct `CustomKeys` +- New struct `CustomKeysWorkspaceConnectionProperties` +- New struct `CustomMetricThreshold` +- New struct `CustomMonitoringSignal` +- New struct `CustomService` +- New struct `DataCollector` +- New struct `DataDriftMonitoringSignal` +- New struct `DataQualityMonitoringSignal` +- New struct `DestinationAsset` +- New struct `Docker` +- New struct `DockerCredential` +- New struct `EncryptionKeyVaultUpdateProperties` +- New struct `EncryptionUpdateProperties` +- New struct `Endpoint` +- New struct `EnvironmentVariable` +- 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 `FixedInputData` +- New struct `FqdnOutboundRule` +- New struct `GetBlobReferenceForConsumptionDto` +- New struct `GetBlobReferenceSASRequestDto` +- New struct `GetBlobReferenceSASResponseDto` +- New struct `IdleShutdownSetting` +- New struct `Image` +- New struct `ImageMetadata` +- New struct `IndexColumn` +- New struct `LakeHouseArtifact` +- New struct `ManagedComputeIdentity` +- New struct `ManagedIdentityCredential` +- New struct `ManagedNetworkProvisionOptions` +- New struct `ManagedNetworkProvisionStatus` +- New struct `ManagedNetworkSettings` +- New struct `MarketplacePlan` +- New struct `MarketplaceSubscription` +- New struct `MarketplaceSubscriptionProperties` +- New struct `MarketplaceSubscriptionResourceArmPaginatedResult` +- New struct `MaterializationComputeResource` +- New struct `MaterializationSettings` +- New struct `ModelSettings` +- New struct `MonitorDefinition` +- New struct `MonitorEmailNotificationSettings` +- New struct `MonitorNotificationSettings` +- New struct `MonitorServerlessSparkCompute` +- New struct `MonitoringTarget` +- New struct `MonitoringThreshold` +- New struct `NotificationSetting` +- New struct `NumericalDataDriftMetricThreshold` +- New struct `NumericalDataQualityMetricThreshold` +- New struct `NumericalPredictionDriftMetricThreshold` +- New struct `OAuth2AuthTypeWorkspaceConnectionProperties` +- New struct `OneLakeDatastore` +- New struct `Operation` +- New struct `OperationDisplay` +- New struct `OperationListResult` +- New struct `OutboundRuleBasicResource` +- New struct `OutboundRuleListResult` +- New struct `PartialMinimalTrackedResourceWithSKUAndIdentity` +- New struct `PartialRegistryPartialTrackedResource` +- New struct `PendingUploadRequestDto` +- New struct `PendingUploadResponseDto` +- New struct `PredictionDriftMonitoringSignal` +- New struct `PrivateEndpointDestination` +- New struct `PrivateEndpointOutboundRule` +- New struct `PrivateEndpointResource` +- New struct `ProxyResource` +- New struct `QueueSettings` +- 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 `RequestLogging` +- New struct `RollingInputData` +- New struct `SASCredential` +- New struct `SASCredentialDto` +- New struct `SecretExpiry` +- New struct `ServerlessComputeSettings` +- New struct `ServerlessEndpoint` +- New struct `ServerlessEndpointProperties` +- New struct `ServerlessEndpointTrackedResourceArmPaginatedResult` +- New struct `ServerlessInferenceEndpoint` +- 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 `StorageAccountDetails` +- New struct `SystemCreatedAcrAccount` +- New struct `SystemCreatedStorageAccount` +- New struct `TmpfsOptions` +- New struct `TopNFeaturesByAttribution` +- New struct `UserCreatedAcrAccount` +- New struct `UserCreatedStorageAccount` +- New struct `VolumeDefinition` +- New struct `VolumeOptions` +- New struct `WorkspaceConnectionAPIKey` +- New struct `WorkspaceConnectionAccessKey` +- New struct `WorkspaceConnectionAccountKey` +- New struct `WorkspaceConnectionOAuth2` +- New struct `WorkspaceConnectionServicePrincipal` +- New struct `WorkspaceHubConfig` +- New field `NotificationSetting`, `QueueSettings` in struct `AutoMLJob` +- New field `ResourceGroup`, `SubscriptionID` in struct `AzureBlobDatastore` +- New field `ResourceGroup`, `SubscriptionID` in struct `AzureDataLakeGen1Datastore` +- New field `ResourceGroup`, `SubscriptionID` in struct `AzureDataLakeGen2Datastore` +- New field `ResourceGroup`, `SubscriptionID` in struct `AzureFileDatastore` +- New field `DeploymentConfiguration` in struct `BatchDeploymentProperties` +- New field `ProvisioningState` in struct `CodeContainerProperties` +- New field `ProvisioningState` in struct `CodeVersionProperties` +- New field `Hash`, `HashVersion` in struct `CodeVersionsClientListOptions` +- New field `NotificationSetting`, `QueueSettings` in struct `CommandJob` +- New field `ProvisioningState` in struct `ComponentContainerProperties` +- New field `ProvisioningState` in struct `ComponentVersionProperties` +- New field `CustomServices`, `OSImageMetadata` in struct `ComputeInstanceProperties` +- New field `Body` in struct `DatastoresClientListSecretsOptions` +- New field `ProvisioningState` in struct `EnvironmentContainerProperties` +- New field `ProvisioningState`, `Stage` in struct `EnvironmentVersionProperties` +- New field `Nodes` in struct `JobService` +- New field `Properties` in struct `JobsClientListOptions` +- New field `DataCollector` in struct `KubernetesOnlineDeployment` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `Group`, `IsSharedToAll`, `Metadata`, `SharedUserList` in struct `ManagedIdentityAuthTypeWorkspaceConnectionProperties` +- New field `DataCollector` in struct `ManagedOnlineDeployment` +- New field `ProvisioningState` in struct `ModelContainerProperties` +- New field `ProvisioningState`, `Stage` in struct `ModelVersionProperties` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `Group`, `IsSharedToAll`, `Metadata`, `SharedUserList` in struct `NoneAuthTypeWorkspaceConnectionProperties` +- New field `DataCollector` in struct `OnlineDeploymentProperties` +- New field `MirrorTraffic` in struct `OnlineEndpointProperties` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `Group`, `IsSharedToAll`, `Metadata`, `SharedUserList` in struct `PATAuthTypeWorkspaceConnectionProperties` +- New field `NotificationSetting` in struct `PipelineJob` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `Group`, `IsSharedToAll`, `Metadata`, `SharedUserList` in struct `SASAuthTypeWorkspaceConnectionProperties` +- New field `NotificationSetting`, `QueueSettings` in struct `SweepJob` +- New field `CreatedByWorkspaceArmID`, `ExpiryTime`, `Group`, `IsSharedToAll`, `Metadata`, `SharedUserList` in struct `UsernamePasswordAuthTypeWorkspaceConnectionProperties` +- New field `Kind` in struct `Workspace` +- New field `SecurityToken` in struct `WorkspaceConnectionUsernamePassword` +- New field `AssociatedWorkspaces`, `EnableDataIsolation`, `FeatureStoreSettings`, `HubResourceID`, `ManagedNetwork`, `ServerlessComputeSettings`, `WorkspaceHubConfig` in struct `WorkspaceProperties` +- New field `EnableDataIsolation`, `Encryption`, `FeatureStoreSettings`, `ManagedNetwork`, `ServerlessComputeSettings`, `V1LegacyMode` in struct `WorkspacePropertiesUpdateParameters` +- New field `ForceToPurge` in struct `WorkspacesClientBeginDeleteOptions` + + ## 3.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/README.md b/sdk/resourcemanager/machinelearning/armmachinelearning/README.md index 1b6c34b27b46..06f7915a489a 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/README.md +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/README.md @@ -1,6 +1,6 @@ # Azure Machine Learning Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4) The `armmachinelearning` module provides operations for working with Azure Machine Learning. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Machine Learning module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v3 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armmachinelearning.NewClientFactory(, cre A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewUsagesClient() +client := clientFactory.NewBatchDeploymentsClient() ``` ## Fakes diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md b/sdk/resourcemanager/machinelearning/armmachinelearning/autorest.md index 143ccd851caf..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.2.0 +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 5ca02dc479c2..16ac832e21db 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/batchdeployments_client.go @@ -47,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-07-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,7 +62,8 @@ func (client *BatchDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchDeploymentsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -75,7 +76,7 @@ func (client *BatchDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, r // 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-07-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" @@ -125,7 +126,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -137,7 +138,7 @@ func (client *BatchDeploymentsClient) createOrUpdateCreateRequest(ctx context.Co // 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Endpoint name @@ -151,7 +152,8 @@ func (client *BatchDeploymentsClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchDeploymentsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -164,7 +166,7 @@ func (client *BatchDeploymentsClient) BeginDelete(ctx context.Context, resourceG // 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-07-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" @@ -214,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,7 +225,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Endpoint name @@ -279,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - endpointName - Endpoint name @@ -349,16 +351,16 @@ func (client *BatchDeploymentsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") 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.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2024-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -376,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-07-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 @@ -404,7 +406,7 @@ func (client *BatchDeploymentsClient) BeginUpdate(ctx context.Context, resourceG // 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-07-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" @@ -454,7 +456,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 949d715b7b47..cf5f7d6c910b 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/batchendpoints_client.go @@ -47,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-07-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,7 +61,8 @@ func (client *BatchEndpointsClient) BeginCreateOrUpdate(ctx context.Context, res return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchEndpointsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -74,7 +75,7 @@ func (client *BatchEndpointsClient) BeginCreateOrUpdate(ctx context.Context, res // 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-07-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" @@ -120,7 +121,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -132,7 +133,7 @@ func (client *BatchEndpointsClient) createOrUpdateCreateRequest(ctx context.Cont // 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-07-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. @@ -145,7 +146,8 @@ func (client *BatchEndpointsClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BatchEndpointsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -158,7 +160,7 @@ func (client *BatchEndpointsClient) BeginDelete(ctx context.Context, resourceGro // 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-07-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" @@ -204,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +215,7 @@ 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-07-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. @@ -264,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,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-07-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. @@ -328,13 +330,13 @@ func (client *BatchEndpointsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") - 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) } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +354,7 @@ 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-07-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. @@ -403,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -421,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-07-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. @@ -448,7 +450,7 @@ func (client *BatchEndpointsClient) BeginUpdate(ctx context.Context, resourceGro // 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-07-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" @@ -494,7 +496,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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/client_factory.go b/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go index c476d99dee0d..7a105697aea0 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -27,174 +26,395 @@ 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, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewBatchDeploymentsClient creates a new instance of BatchDeploymentsClient. func (c *ClientFactory) NewBatchDeploymentsClient() *BatchDeploymentsClient { - subClient, _ := NewBatchDeploymentsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &BatchDeploymentsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewBatchEndpointsClient creates a new instance of BatchEndpointsClient. func (c *ClientFactory) NewBatchEndpointsClient() *BatchEndpointsClient { - subClient, _ := NewBatchEndpointsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &BatchEndpointsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCodeContainersClient creates a new instance of CodeContainersClient. func (c *ClientFactory) NewCodeContainersClient() *CodeContainersClient { - subClient, _ := NewCodeContainersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CodeContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewCodeVersionsClient creates a new instance of CodeVersionsClient. func (c *ClientFactory) NewCodeVersionsClient() *CodeVersionsClient { - subClient, _ := NewCodeVersionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &CodeVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewComponentContainersClient creates a new instance of ComponentContainersClient. func (c *ClientFactory) NewComponentContainersClient() *ComponentContainersClient { - subClient, _ := NewComponentContainersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ComponentContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewComponentVersionsClient creates a new instance of ComponentVersionsClient. func (c *ClientFactory) NewComponentVersionsClient() *ComponentVersionsClient { - subClient, _ := NewComponentVersionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ComponentVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewComputeClient creates a new instance of ComputeClient. func (c *ClientFactory) NewComputeClient() *ComputeClient { - subClient, _ := NewComputeClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ComputeClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDataContainersClient creates a new instance of DataContainersClient. func (c *ClientFactory) NewDataContainersClient() *DataContainersClient { - subClient, _ := NewDataContainersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DataContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDataVersionsClient creates a new instance of DataVersionsClient. func (c *ClientFactory) NewDataVersionsClient() *DataVersionsClient { - subClient, _ := NewDataVersionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DataVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewDatastoresClient creates a new instance of DatastoresClient. func (c *ClientFactory) NewDatastoresClient() *DatastoresClient { - subClient, _ := NewDatastoresClient(c.subscriptionID, c.credential, c.options) - return subClient + return &DatastoresClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewEnvironmentContainersClient creates a new instance of EnvironmentContainersClient. func (c *ClientFactory) NewEnvironmentContainersClient() *EnvironmentContainersClient { - subClient, _ := NewEnvironmentContainersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &EnvironmentContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewEnvironmentVersionsClient creates a new instance of EnvironmentVersionsClient. func (c *ClientFactory) NewEnvironmentVersionsClient() *EnvironmentVersionsClient { - subClient, _ := NewEnvironmentVersionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &EnvironmentVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewFeaturesClient creates a new instance of FeaturesClient. +func (c *ClientFactory) NewFeaturesClient() *FeaturesClient { + return &FeaturesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewFeaturesetContainersClient creates a new instance of FeaturesetContainersClient. +func (c *ClientFactory) NewFeaturesetContainersClient() *FeaturesetContainersClient { + return &FeaturesetContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewFeaturesetVersionsClient creates a new instance of FeaturesetVersionsClient. +func (c *ClientFactory) NewFeaturesetVersionsClient() *FeaturesetVersionsClient { + return &FeaturesetVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewFeaturestoreEntityContainersClient creates a new instance of FeaturestoreEntityContainersClient. +func (c *ClientFactory) NewFeaturestoreEntityContainersClient() *FeaturestoreEntityContainersClient { + return &FeaturestoreEntityContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewFeaturestoreEntityVersionsClient creates a new instance of FeaturestoreEntityVersionsClient. +func (c *ClientFactory) NewFeaturestoreEntityVersionsClient() *FeaturestoreEntityVersionsClient { + return &FeaturestoreEntityVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewJobsClient creates a new instance of JobsClient. func (c *ClientFactory) NewJobsClient() *JobsClient { - subClient, _ := NewJobsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &JobsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewManagedNetworkProvisionsClient creates a new instance of ManagedNetworkProvisionsClient. +func (c *ClientFactory) NewManagedNetworkProvisionsClient() *ManagedNetworkProvisionsClient { + return &ManagedNetworkProvisionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewManagedNetworkSettingsRuleClient creates a new instance of ManagedNetworkSettingsRuleClient. +func (c *ClientFactory) NewManagedNetworkSettingsRuleClient() *ManagedNetworkSettingsRuleClient { + return &ManagedNetworkSettingsRuleClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewMarketplaceSubscriptionsClient creates a new instance of MarketplaceSubscriptionsClient. +func (c *ClientFactory) NewMarketplaceSubscriptionsClient() *MarketplaceSubscriptionsClient { + return &MarketplaceSubscriptionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewModelContainersClient creates a new instance of ModelContainersClient. func (c *ClientFactory) NewModelContainersClient() *ModelContainersClient { - subClient, _ := NewModelContainersClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ModelContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewModelVersionsClient creates a new instance of ModelVersionsClient. func (c *ClientFactory) NewModelVersionsClient() *ModelVersionsClient { - subClient, _ := NewModelVersionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ModelVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOnlineDeploymentsClient creates a new instance of OnlineDeploymentsClient. func (c *ClientFactory) NewOnlineDeploymentsClient() *OnlineDeploymentsClient { - subClient, _ := NewOnlineDeploymentsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &OnlineDeploymentsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOnlineEndpointsClient creates a new instance of OnlineEndpointsClient. func (c *ClientFactory) NewOnlineEndpointsClient() *OnlineEndpointsClient { - subClient, _ := NewOnlineEndpointsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &OnlineEndpointsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewQuotasClient creates a new instance of QuotasClient. func (c *ClientFactory) NewQuotasClient() *QuotasClient { - subClient, _ := NewQuotasClient(c.subscriptionID, c.credential, c.options) - return subClient + return &QuotasClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistriesClient creates a new instance of RegistriesClient. +func (c *ClientFactory) NewRegistriesClient() *RegistriesClient { + return &RegistriesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryCodeContainersClient creates a new instance of RegistryCodeContainersClient. +func (c *ClientFactory) NewRegistryCodeContainersClient() *RegistryCodeContainersClient { + return &RegistryCodeContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryCodeVersionsClient creates a new instance of RegistryCodeVersionsClient. +func (c *ClientFactory) NewRegistryCodeVersionsClient() *RegistryCodeVersionsClient { + return &RegistryCodeVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryComponentContainersClient creates a new instance of RegistryComponentContainersClient. +func (c *ClientFactory) NewRegistryComponentContainersClient() *RegistryComponentContainersClient { + return &RegistryComponentContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryComponentVersionsClient creates a new instance of RegistryComponentVersionsClient. +func (c *ClientFactory) NewRegistryComponentVersionsClient() *RegistryComponentVersionsClient { + return &RegistryComponentVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryDataContainersClient creates a new instance of RegistryDataContainersClient. +func (c *ClientFactory) NewRegistryDataContainersClient() *RegistryDataContainersClient { + return &RegistryDataContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryDataReferencesClient creates a new instance of RegistryDataReferencesClient. +func (c *ClientFactory) NewRegistryDataReferencesClient() *RegistryDataReferencesClient { + return &RegistryDataReferencesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryDataVersionsClient creates a new instance of RegistryDataVersionsClient. +func (c *ClientFactory) NewRegistryDataVersionsClient() *RegistryDataVersionsClient { + return &RegistryDataVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryEnvironmentContainersClient creates a new instance of RegistryEnvironmentContainersClient. +func (c *ClientFactory) NewRegistryEnvironmentContainersClient() *RegistryEnvironmentContainersClient { + return &RegistryEnvironmentContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryEnvironmentVersionsClient creates a new instance of RegistryEnvironmentVersionsClient. +func (c *ClientFactory) NewRegistryEnvironmentVersionsClient() *RegistryEnvironmentVersionsClient { + return &RegistryEnvironmentVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryModelContainersClient creates a new instance of RegistryModelContainersClient. +func (c *ClientFactory) NewRegistryModelContainersClient() *RegistryModelContainersClient { + return &RegistryModelContainersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewRegistryModelVersionsClient creates a new instance of RegistryModelVersionsClient. +func (c *ClientFactory) NewRegistryModelVersionsClient() *RegistryModelVersionsClient { + return &RegistryModelVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSchedulesClient creates a new instance of SchedulesClient. func (c *ClientFactory) NewSchedulesClient() *SchedulesClient { - subClient, _ := NewSchedulesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SchedulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewServerlessEndpointsClient creates a new instance of ServerlessEndpointsClient. +func (c *ClientFactory) NewServerlessEndpointsClient() *ServerlessEndpointsClient { + return &ServerlessEndpointsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUsagesClient creates a new instance of UsagesClient. func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient. func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { - subClient, _ := NewVirtualMachineSizesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &VirtualMachineSizesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWorkspaceConnectionsClient creates a new instance of WorkspaceConnectionsClient. func (c *ClientFactory) NewWorkspaceConnectionsClient() *WorkspaceConnectionsClient { - subClient, _ := NewWorkspaceConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WorkspaceConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWorkspaceFeaturesClient creates a new instance of WorkspaceFeaturesClient. func (c *ClientFactory) NewWorkspaceFeaturesClient() *WorkspaceFeaturesClient { - subClient, _ := NewWorkspaceFeaturesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WorkspaceFeaturesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewWorkspacesClient creates a new instance of WorkspacesClient. func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { - subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &WorkspacesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go index 6dfb43e6a570..04fe2bbc2fff 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/codecontainers_client.go @@ -46,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-07-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. @@ -99,7 +99,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -120,7 +120,7 @@ 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-07-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. @@ -170,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +179,7 @@ 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-07-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. @@ -230,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,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-07-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. @@ -294,10 +294,10 @@ func (client *CodeContainersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-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/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 a5c524b039de..3364aeb908ce 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/codeversions_client.go @@ -44,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-07-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-07-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-07-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. @@ -105,7 +184,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -126,7 +205,7 @@ 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-07-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. @@ -181,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +269,7 @@ 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-07-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. @@ -246,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,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-07-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. @@ -315,15 +394,21 @@ func (client *CodeVersionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.OrderBy != nil { reqQP.Set("$orderBy", *options.OrderBy) } + 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)) } - if options != nil && options.Skip != nil { - reqQP.Set("$skip", *options.Skip) + reqQP.Set("api-version", "2024-07-01-preview") + 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"} @@ -338,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-07-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-07-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.StatusOK, 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-07-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 d6c0921658b1..d2cf6230359e 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/componentcontainers_client.go @@ -46,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -99,7 +99,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -120,7 +120,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -171,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -231,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,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-07-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 @@ -296,10 +296,10 @@ func (client *ComponentContainersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } 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 93365130118a..7c640d1818cc 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/componentversions_client.go @@ -47,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -105,7 +105,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -126,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -182,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -247,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Component name. @@ -317,16 +317,16 @@ func (client *ComponentVersionsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") 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.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } @@ -343,3 +343,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-07-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-07-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.StatusOK, 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-07-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 56326713a750..d2baac4164f4 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/compute_client.go @@ -48,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-07-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. @@ -77,7 +77,7 @@ 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-07-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" @@ -123,7 +123,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -135,7 +135,7 @@ func (client *ComputeClient) createOrUpdateCreateRequest(ctx context.Context, re // 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-07-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. @@ -162,7 +162,7 @@ func (client *ComputeClient) BeginDelete(ctx context.Context, resourceGroupName // 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-07-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" @@ -208,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-07-01-preview") reqQP.Set("underlyingResourceAction", string(underlyingResourceAction)) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -219,7 +219,7 @@ 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-07-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. @@ -270,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,7 @@ func (client *ComputeClient) getHandleResponse(resp *http.Response) (ComputeClie // NewListPager - Gets computes in specified workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-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. @@ -334,10 +334,10 @@ func (client *ComputeClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -355,7 +355,7 @@ 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-07-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. @@ -406,7 +406,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +423,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-07-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. @@ -475,7 +475,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -493,7 +493,7 @@ func (client *ComputeClient) listNodesHandleResponse(resp *http.Response) (Compu // 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-07-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. @@ -518,7 +518,7 @@ func (client *ComputeClient) BeginRestart(ctx context.Context, resourceGroupName // 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-07-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" @@ -564,7 +564,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -573,7 +573,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-07-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. @@ -598,7 +598,7 @@ func (client *ComputeClient) BeginStart(ctx context.Context, resourceGroupName s // 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-07-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" @@ -644,7 +644,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -653,7 +653,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-07-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. @@ -678,7 +678,7 @@ func (client *ComputeClient) BeginStop(ctx context.Context, resourceGroupName st // 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-07-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" @@ -724,7 +724,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -734,7 +734,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-07-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. @@ -760,7 +760,7 @@ func (client *ComputeClient) BeginUpdate(ctx context.Context, resourceGroupName // 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-07-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" @@ -806,7 +806,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != 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 b49591c7749a..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.000Z"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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.000Z"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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.000Z"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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.000Z"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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.000Z"); return t}()), - // IsAttachedCompute: to.Ptr(true), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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.000Z"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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.000Z"); return t}()), - // ModifiedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T22:00:00.000Z"); 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 a54f2d1189dc..ba10af6ad765 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/constants.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/constants.go @@ -10,9 +10,23 @@ package armmachinelearning const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning" - moduleVersion = "v3.2.0" + 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 @@ -51,6 +65,30 @@ 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, + } +} + // AutoRebuildSetting - AutoRebuild setting for the derived image type AutoRebuildSetting string @@ -85,6 +123,22 @@ func PossibleAutosaveValues() []Autosave { } } +// 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 @@ -198,6 +252,66 @@ 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, + } +} + // ClassificationModels - Enum for all classification models supported by AutoML. type ClassificationModels string @@ -435,6 +549,49 @@ 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, + } +} + +// ComputeTriggerType - Is the trigger type recurrence or cron. +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 @@ -467,24 +624,71 @@ 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 ( + ConnectionAuthTypeAAD ConnectionAuthType = "AAD" + ConnectionAuthTypeAPIKey ConnectionAuthType = "ApiKey" + ConnectionAuthTypeAccessKey ConnectionAuthType = "AccessKey" + ConnectionAuthTypeAccountKey ConnectionAuthType = "AccountKey" + ConnectionAuthTypeCustomKeys ConnectionAuthType = "CustomKeys" ConnectionAuthTypeManagedIdentity ConnectionAuthType = "ManagedIdentity" ConnectionAuthTypeNone ConnectionAuthType = "None" + ConnectionAuthTypeOAuth2 ConnectionAuthType = "OAuth2" 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{ + ConnectionAuthTypeAAD, + ConnectionAuthTypeAPIKey, + ConnectionAuthTypeAccessKey, + ConnectionAuthTypeAccountKey, + ConnectionAuthTypeCustomKeys, ConnectionAuthTypeManagedIdentity, ConnectionAuthTypeNone, + ConnectionAuthTypeOAuth2, ConnectionAuthTypePAT, ConnectionAuthTypeSAS, + ConnectionAuthTypeServicePrincipal, ConnectionAuthTypeUsernamePassword, } } @@ -493,17 +697,241 @@ func PossibleConnectionAuthTypeValues() []ConnectionAuthType { type ConnectionCategory string const ( - ConnectionCategoryContainerRegistry ConnectionCategory = "ContainerRegistry" - ConnectionCategoryGit ConnectionCategory = "Git" - ConnectionCategoryPythonFeed ConnectionCategory = "PythonFeed" + ConnectionCategoryADLSGen2 ConnectionCategory = "ADLSGen2" + ConnectionCategoryAIServices ConnectionCategory = "AIServices" + ConnectionCategoryAPIKey ConnectionCategory = "ApiKey" + ConnectionCategoryAmazonMws ConnectionCategory = "AmazonMws" + ConnectionCategoryAmazonRdsForOracle ConnectionCategory = "AmazonRdsForOracle" + ConnectionCategoryAmazonRdsForSQLServer ConnectionCategory = "AmazonRdsForSqlServer" + ConnectionCategoryAmazonRedshift ConnectionCategory = "AmazonRedshift" + ConnectionCategoryAmazonS3Compatible ConnectionCategory = "AmazonS3Compatible" + ConnectionCategoryAzureBlob ConnectionCategory = "AzureBlob" + ConnectionCategoryAzureDataExplorer ConnectionCategory = "AzureDataExplorer" + ConnectionCategoryAzureDatabricksDeltaLake ConnectionCategory = "AzureDatabricksDeltaLake" + ConnectionCategoryAzureMariaDb ConnectionCategory = "AzureMariaDb" + ConnectionCategoryAzureMySQLDb ConnectionCategory = "AzureMySqlDb" + ConnectionCategoryAzureOneLake ConnectionCategory = "AzureOneLake" + ConnectionCategoryAzureOpenAI ConnectionCategory = "AzureOpenAI" + ConnectionCategoryAzurePostgresDb ConnectionCategory = "AzurePostgresDb" + ConnectionCategoryAzureSQLDb ConnectionCategory = "AzureSqlDb" + ConnectionCategoryAzureSQLMi ConnectionCategory = "AzureSqlMi" + ConnectionCategoryAzureSynapseAnalytics ConnectionCategory = "AzureSynapseAnalytics" + ConnectionCategoryAzureTableStorage ConnectionCategory = "AzureTableStorage" + ConnectionCategoryBingLLMSearch ConnectionCategory = "BingLLMSearch" + ConnectionCategoryCassandra ConnectionCategory = "Cassandra" + ConnectionCategoryCognitiveSearch ConnectionCategory = "CognitiveSearch" + ConnectionCategoryCognitiveService ConnectionCategory = "CognitiveService" + ConnectionCategoryConcur ConnectionCategory = "Concur" + ConnectionCategoryContainerRegistry ConnectionCategory = "ContainerRegistry" + ConnectionCategoryCosmosDb ConnectionCategory = "CosmosDb" + ConnectionCategoryCosmosDbMongoDbAPI ConnectionCategory = "CosmosDbMongoDbApi" + ConnectionCategoryCouchbase ConnectionCategory = "Couchbase" + ConnectionCategoryCustomKeys ConnectionCategory = "CustomKeys" + ConnectionCategoryDb2 ConnectionCategory = "Db2" + ConnectionCategoryDrill ConnectionCategory = "Drill" + ConnectionCategoryDynamics ConnectionCategory = "Dynamics" + ConnectionCategoryDynamicsAx ConnectionCategory = "DynamicsAx" + ConnectionCategoryDynamicsCrm ConnectionCategory = "DynamicsCrm" + ConnectionCategoryEloqua ConnectionCategory = "Eloqua" + ConnectionCategoryFileServer ConnectionCategory = "FileServer" + ConnectionCategoryFtpServer ConnectionCategory = "FtpServer" + ConnectionCategoryGenericContainerRegistry ConnectionCategory = "GenericContainerRegistry" + ConnectionCategoryGenericHTTP ConnectionCategory = "GenericHttp" + ConnectionCategoryGenericRest ConnectionCategory = "GenericRest" + ConnectionCategoryGit ConnectionCategory = "Git" + ConnectionCategoryGoogleAdWords ConnectionCategory = "GoogleAdWords" + ConnectionCategoryGoogleBigQuery ConnectionCategory = "GoogleBigQuery" + ConnectionCategoryGoogleCloudStorage ConnectionCategory = "GoogleCloudStorage" + ConnectionCategoryGreenplum ConnectionCategory = "Greenplum" + ConnectionCategoryHbase ConnectionCategory = "Hbase" + ConnectionCategoryHdfs ConnectionCategory = "Hdfs" + ConnectionCategoryHive ConnectionCategory = "Hive" + ConnectionCategoryHubspot ConnectionCategory = "Hubspot" + ConnectionCategoryImpala ConnectionCategory = "Impala" + ConnectionCategoryInformix ConnectionCategory = "Informix" + ConnectionCategoryJira ConnectionCategory = "Jira" + ConnectionCategoryMagento ConnectionCategory = "Magento" + ConnectionCategoryMariaDb ConnectionCategory = "MariaDb" + ConnectionCategoryMarketo ConnectionCategory = "Marketo" + ConnectionCategoryMicrosoftAccess ConnectionCategory = "MicrosoftAccess" + ConnectionCategoryMongoDbAtlas ConnectionCategory = "MongoDbAtlas" + ConnectionCategoryMongoDbV2 ConnectionCategory = "MongoDbV2" + ConnectionCategoryMySQL ConnectionCategory = "MySql" + ConnectionCategoryNetezza ConnectionCategory = "Netezza" + ConnectionCategoryODataRest ConnectionCategory = "ODataRest" + ConnectionCategoryOdbc ConnectionCategory = "Odbc" + ConnectionCategoryOffice365 ConnectionCategory = "Office365" + ConnectionCategoryOpenAI ConnectionCategory = "OpenAI" + ConnectionCategoryOracle ConnectionCategory = "Oracle" + ConnectionCategoryOracleCloudStorage ConnectionCategory = "OracleCloudStorage" + ConnectionCategoryOracleServiceCloud ConnectionCategory = "OracleServiceCloud" + ConnectionCategoryPayPal ConnectionCategory = "PayPal" + ConnectionCategoryPhoenix ConnectionCategory = "Phoenix" + ConnectionCategoryPostgreSQL ConnectionCategory = "PostgreSql" + ConnectionCategoryPresto ConnectionCategory = "Presto" + ConnectionCategoryPythonFeed ConnectionCategory = "PythonFeed" + ConnectionCategoryQuickBooks ConnectionCategory = "QuickBooks" + ConnectionCategoryRedis ConnectionCategory = "Redis" + ConnectionCategoryResponsys ConnectionCategory = "Responsys" + ConnectionCategoryS3 ConnectionCategory = "S3" + ConnectionCategorySQLServer ConnectionCategory = "SqlServer" + ConnectionCategorySalesforce ConnectionCategory = "Salesforce" + ConnectionCategorySalesforceMarketingCloud ConnectionCategory = "SalesforceMarketingCloud" + ConnectionCategorySalesforceServiceCloud ConnectionCategory = "SalesforceServiceCloud" + ConnectionCategorySapBw ConnectionCategory = "SapBw" + ConnectionCategorySapCloudForCustomer ConnectionCategory = "SapCloudForCustomer" + ConnectionCategorySapEcc ConnectionCategory = "SapEcc" + ConnectionCategorySapHana ConnectionCategory = "SapHana" + ConnectionCategorySapOpenHub ConnectionCategory = "SapOpenHub" + ConnectionCategorySapTable ConnectionCategory = "SapTable" + ConnectionCategorySerp ConnectionCategory = "Serp" + ConnectionCategoryServerless ConnectionCategory = "Serverless" + ConnectionCategoryServiceNow ConnectionCategory = "ServiceNow" + ConnectionCategorySftp ConnectionCategory = "Sftp" + ConnectionCategorySharePointOnlineList ConnectionCategory = "SharePointOnlineList" + ConnectionCategoryShopify ConnectionCategory = "Shopify" + ConnectionCategorySnowflake ConnectionCategory = "Snowflake" + ConnectionCategorySpark ConnectionCategory = "Spark" + ConnectionCategorySquare ConnectionCategory = "Square" + ConnectionCategorySybase ConnectionCategory = "Sybase" + ConnectionCategoryTeradata ConnectionCategory = "Teradata" + ConnectionCategoryVertica ConnectionCategory = "Vertica" + ConnectionCategoryWebTable ConnectionCategory = "WebTable" + ConnectionCategoryXero ConnectionCategory = "Xero" + ConnectionCategoryZoho ConnectionCategory = "Zoho" ) // PossibleConnectionCategoryValues returns the possible values for the ConnectionCategory const type. func PossibleConnectionCategoryValues() []ConnectionCategory { return []ConnectionCategory{ + ConnectionCategoryADLSGen2, + ConnectionCategoryAIServices, + ConnectionCategoryAPIKey, + ConnectionCategoryAmazonMws, + ConnectionCategoryAmazonRdsForOracle, + ConnectionCategoryAmazonRdsForSQLServer, + ConnectionCategoryAmazonRedshift, + ConnectionCategoryAmazonS3Compatible, + ConnectionCategoryAzureBlob, + ConnectionCategoryAzureDataExplorer, + ConnectionCategoryAzureDatabricksDeltaLake, + ConnectionCategoryAzureMariaDb, + ConnectionCategoryAzureMySQLDb, + ConnectionCategoryAzureOneLake, + ConnectionCategoryAzureOpenAI, + ConnectionCategoryAzurePostgresDb, + ConnectionCategoryAzureSQLDb, + ConnectionCategoryAzureSQLMi, + ConnectionCategoryAzureSynapseAnalytics, + ConnectionCategoryAzureTableStorage, + ConnectionCategoryBingLLMSearch, + ConnectionCategoryCassandra, + ConnectionCategoryCognitiveSearch, + ConnectionCategoryCognitiveService, + ConnectionCategoryConcur, ConnectionCategoryContainerRegistry, + ConnectionCategoryCosmosDb, + ConnectionCategoryCosmosDbMongoDbAPI, + ConnectionCategoryCouchbase, + ConnectionCategoryCustomKeys, + ConnectionCategoryDb2, + ConnectionCategoryDrill, + ConnectionCategoryDynamics, + ConnectionCategoryDynamicsAx, + ConnectionCategoryDynamicsCrm, + ConnectionCategoryEloqua, + ConnectionCategoryFileServer, + ConnectionCategoryFtpServer, + ConnectionCategoryGenericContainerRegistry, + ConnectionCategoryGenericHTTP, + ConnectionCategoryGenericRest, ConnectionCategoryGit, + ConnectionCategoryGoogleAdWords, + ConnectionCategoryGoogleBigQuery, + ConnectionCategoryGoogleCloudStorage, + ConnectionCategoryGreenplum, + ConnectionCategoryHbase, + ConnectionCategoryHdfs, + ConnectionCategoryHive, + ConnectionCategoryHubspot, + ConnectionCategoryImpala, + ConnectionCategoryInformix, + ConnectionCategoryJira, + ConnectionCategoryMagento, + ConnectionCategoryMariaDb, + ConnectionCategoryMarketo, + ConnectionCategoryMicrosoftAccess, + ConnectionCategoryMongoDbAtlas, + ConnectionCategoryMongoDbV2, + ConnectionCategoryMySQL, + ConnectionCategoryNetezza, + ConnectionCategoryODataRest, + ConnectionCategoryOdbc, + ConnectionCategoryOffice365, + ConnectionCategoryOpenAI, + ConnectionCategoryOracle, + ConnectionCategoryOracleCloudStorage, + ConnectionCategoryOracleServiceCloud, + ConnectionCategoryPayPal, + ConnectionCategoryPhoenix, + ConnectionCategoryPostgreSQL, + ConnectionCategoryPresto, ConnectionCategoryPythonFeed, + ConnectionCategoryQuickBooks, + ConnectionCategoryRedis, + ConnectionCategoryResponsys, + ConnectionCategoryS3, + ConnectionCategorySQLServer, + ConnectionCategorySalesforce, + ConnectionCategorySalesforceMarketingCloud, + ConnectionCategorySalesforceServiceCloud, + ConnectionCategorySapBw, + ConnectionCategorySapCloudForCustomer, + ConnectionCategorySapEcc, + ConnectionCategorySapHana, + ConnectionCategorySapOpenHub, + ConnectionCategorySapTable, + ConnectionCategorySerp, + ConnectionCategoryServerless, + ConnectionCategoryServiceNow, + ConnectionCategorySftp, + ConnectionCategorySharePointOnlineList, + ConnectionCategoryShopify, + ConnectionCategorySnowflake, + ConnectionCategorySpark, + ConnectionCategorySquare, + ConnectionCategorySybase, + ConnectionCategoryTeradata, + ConnectionCategoryVertica, + ConnectionCategoryWebTable, + ConnectionCategoryXero, + ConnectionCategoryZoho, + } +} + +// ConnectionGroup - Group based on connection category +type ConnectionGroup string + +const ( + ConnectionGroupAzure ConnectionGroup = "Azure" + ConnectionGroupAzureAI ConnectionGroup = "AzureAI" + ConnectionGroupDatabase ConnectionGroup = "Database" + ConnectionGroupFile ConnectionGroup = "File" + ConnectionGroupGenericProtocol ConnectionGroup = "GenericProtocol" + ConnectionGroupNoSQL ConnectionGroup = "NoSQL" + ConnectionGroupServicesAndApps ConnectionGroup = "ServicesAndApps" +) + +// PossibleConnectionGroupValues returns the possible values for the ConnectionGroup const type. +func PossibleConnectionGroupValues() []ConnectionGroup { + return []ConnectionGroup{ + ConnectionGroupAzure, + ConnectionGroupAzureAI, + ConnectionGroupDatabase, + ConnectionGroupFile, + ConnectionGroupGenericProtocol, + ConnectionGroupNoSQL, + ConnectionGroupServicesAndApps, } } @@ -522,6 +950,22 @@ func PossibleContainerTypeValues() []ContainerType { } } +// ContentSafetyStatus - Specifies the status of content safety. +type ContentSafetyStatus string + +const ( + ContentSafetyStatusDisabled ContentSafetyStatus = "Disabled" + ContentSafetyStatusEnabled ContentSafetyStatus = "Enabled" +) + +// PossibleContentSafetyStatusValues returns the possible values for the ContentSafetyStatus const type. +func PossibleContentSafetyStatusValues() []ContentSafetyStatus { + return []ContentSafetyStatus{ + ContentSafetyStatusDisabled, + ContentSafetyStatusEnabled, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -564,6 +1008,60 @@ func PossibleCredentialsTypeValues() []CredentialsType { } } +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, + } +} + +// 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 @@ -590,6 +1088,7 @@ const ( DatastoreTypeAzureDataLakeGen1 DatastoreType = "AzureDataLakeGen1" DatastoreTypeAzureDataLakeGen2 DatastoreType = "AzureDataLakeGen2" DatastoreTypeAzureFile DatastoreType = "AzureFile" + DatastoreTypeOneLake DatastoreType = "OneLake" ) // PossibleDatastoreTypeValues returns the possible values for the DatastoreType const type. @@ -599,6 +1098,7 @@ func PossibleDatastoreTypeValues() []DatastoreType { DatastoreTypeAzureDataLakeGen1, DatastoreTypeAzureDataLakeGen2, DatastoreTypeAzureFile, + DatastoreTypeOneLake, } } @@ -697,6 +1197,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 @@ -773,6 +1291,26 @@ 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" +) + +// PossibleEndpointServiceConnectionStatusValues returns the possible values for the EndpointServiceConnectionStatus const type. +func PossibleEndpointServiceConnectionStatusValues() []EndpointServiceConnectionStatus { + return []EndpointServiceConnectionStatus{ + EndpointServiceConnectionStatusApproved, + EndpointServiceConnectionStatusDisconnected, + EndpointServiceConnectionStatusPending, + EndpointServiceConnectionStatusRejected, + } +} + // EnvironmentType - Environment type is either user created or curated by Azure ML service type EnvironmentType string @@ -789,6 +1327,79 @@ 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, + } +} + +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 @@ -1005,6 +1616,22 @@ func PossibleIdentityConfigurationTypeValues() []IdentityConfigurationType { } } +// ImageType - Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images +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, + } +} + // InputDeliveryMode - Enum to determine the input data delivery mode. type InputDeliveryMode string @@ -1045,6 +1672,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 @@ -1169,6 +1814,28 @@ func PossibleJobStatusValues() []JobStatus { } } +// 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 @@ -1176,6 +1843,7 @@ const ( JobTypeAutoML JobType = "AutoML" JobTypeCommand JobType = "Command" JobTypePipeline JobType = "Pipeline" + JobTypeSpark JobType = "Spark" JobTypeSweep JobType = "Sweep" ) @@ -1185,6 +1853,7 @@ func PossibleJobTypeValues() []JobType { JobTypeAutoML, JobTypeCommand, JobTypePipeline, + JobTypeSpark, JobTypeSweep, } } @@ -1288,6 +1957,22 @@ func PossibleLogVerbosityValues() []LogVerbosity { } } +// 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 @@ -1308,6 +1993,78 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } +type MarketplaceSubscriptionProvisioningState string + +const ( + MarketplaceSubscriptionProvisioningStateCanceled MarketplaceSubscriptionProvisioningState = "Canceled" + // MarketplaceSubscriptionProvisioningStateCreating - MarketplaceSubscription is being created. + MarketplaceSubscriptionProvisioningStateCreating MarketplaceSubscriptionProvisioningState = "Creating" + // MarketplaceSubscriptionProvisioningStateDeleting - MarketplaceSubscription is being deleted. + MarketplaceSubscriptionProvisioningStateDeleting MarketplaceSubscriptionProvisioningState = "Deleting" + // MarketplaceSubscriptionProvisioningStateFailed - MarketplaceSubscription provisioning failed. + MarketplaceSubscriptionProvisioningStateFailed MarketplaceSubscriptionProvisioningState = "Failed" + // MarketplaceSubscriptionProvisioningStateSucceeded - MarketplaceSubscription is successfully provisioned. + MarketplaceSubscriptionProvisioningStateSucceeded MarketplaceSubscriptionProvisioningState = "Succeeded" + // MarketplaceSubscriptionProvisioningStateUpdating - MarketplaceSubscription is being updated. + MarketplaceSubscriptionProvisioningStateUpdating MarketplaceSubscriptionProvisioningState = "Updating" +) + +// PossibleMarketplaceSubscriptionProvisioningStateValues returns the possible values for the MarketplaceSubscriptionProvisioningState const type. +func PossibleMarketplaceSubscriptionProvisioningStateValues() []MarketplaceSubscriptionProvisioningState { + return []MarketplaceSubscriptionProvisioningState{ + MarketplaceSubscriptionProvisioningStateCanceled, + MarketplaceSubscriptionProvisioningStateCreating, + MarketplaceSubscriptionProvisioningStateDeleting, + MarketplaceSubscriptionProvisioningStateFailed, + MarketplaceSubscriptionProvisioningStateSucceeded, + MarketplaceSubscriptionProvisioningStateUpdating, + } +} + +type MarketplaceSubscriptionStatus string + +const ( + // MarketplaceSubscriptionStatusSubscribed - The customer can now use the Marketplace Subscription's + // model and will be billed. + MarketplaceSubscriptionStatusSubscribed MarketplaceSubscriptionStatus = "Subscribed" + // MarketplaceSubscriptionStatusSuspended - The customer could not be billed for the Marketplace Subscription. + // The customer will not be able to access the model. + MarketplaceSubscriptionStatusSuspended MarketplaceSubscriptionStatus = "Suspended" + // MarketplaceSubscriptionStatusUnsubscribed - Marketplace Subscriptions reach this state in response to an explicit customer + // or CSP action. + // A Marketplace Subscription can also be canceled implicitly, as a result of nonpayment of dues, + // after being in the Suspended state for some time. + MarketplaceSubscriptionStatusUnsubscribed MarketplaceSubscriptionStatus = "Unsubscribed" +) + +// PossibleMarketplaceSubscriptionStatusValues returns the possible values for the MarketplaceSubscriptionStatus const type. +func PossibleMarketplaceSubscriptionStatusValues() []MarketplaceSubscriptionStatus { + return []MarketplaceSubscriptionStatus{ + MarketplaceSubscriptionStatusSubscribed, + MarketplaceSubscriptionStatusSuspended, + MarketplaceSubscriptionStatusUnsubscribed, + } +} + +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, + } +} + // ModelSize - Image model size. type ModelSize string @@ -1335,6 +2092,156 @@ func PossibleModelSizeValues() []ModelSize { } } +// ModelTaskType - Model task type enum. +type ModelTaskType string + +const ( + ModelTaskTypeClassification ModelTaskType = "Classification" + ModelTaskTypeRegression ModelTaskType = "Regression" +) + +// PossibleModelTaskTypeValues returns the possible values for the ModelTaskType const type. +func PossibleModelTaskTypeValues() []ModelTaskType { + return []ModelTaskType{ + ModelTaskTypeClassification, + 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 MonitoringNotificationType string + +const ( + // MonitoringNotificationTypeAmlNotification - Enables email notifications through AML notifications. + MonitoringNotificationTypeAmlNotification MonitoringNotificationType = "AmlNotification" +) + +// PossibleMonitoringNotificationTypeValues returns the possible values for the MonitoringNotificationType const type. +func PossibleMonitoringNotificationTypeValues() []MonitoringNotificationType { + return []MonitoringNotificationType{ + MonitoringNotificationTypeAmlNotification, + } +} + +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" + // 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, + MonitoringSignalTypePredictionDrift, + } +} + // MountAction - Mount Action. type MountAction string @@ -1434,6 +2341,87 @@ func PossibleNodeStateValues() []NodeState { } } +// NodesValueType - The enumerated types for the nodes value +type NodesValueType string + +const ( + NodesValueTypeAll NodesValueType = "All" +) + +// PossibleNodesValueTypeValues returns the possible values for the NodesValueType const type. +func PossibleNodesValueTypeValues() []NodesValueType { + return []NodesValueType{ + NodesValueTypeAll, + } +} + +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 @@ -1450,6 +2438,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 @@ -1555,6 +2557,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 @@ -1575,6 +2596,7 @@ func PossibleOsTypeValues() []OsType { type OutputDeliveryMode string const ( + OutputDeliveryModeDirect OutputDeliveryMode = "Direct" OutputDeliveryModeReadWriteMount OutputDeliveryMode = "ReadWriteMount" OutputDeliveryModeUpload OutputDeliveryMode = "Upload" ) @@ -1582,11 +2604,42 @@ const ( // PossibleOutputDeliveryModeValues returns the possible values for the OutputDeliveryMode const type. func PossibleOutputDeliveryModeValues() []OutputDeliveryMode { return []OutputDeliveryMode{ + OutputDeliveryModeDirect, OutputDeliveryModeReadWriteMount, OutputDeliveryModeUpload, } } +// 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, + } +} + // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -1629,6 +2682,24 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } +// Protocol - Protocol over which communication will happen over this endpoint +type Protocol string + +const ( + ProtocolHTTP Protocol = "http" + ProtocolTCP Protocol = "tcp" + ProtocolUDP Protocol = "udp" +) + +// 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. type ProvisioningState string @@ -1887,6 +2958,97 @@ 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 ( + RuleCategoryDependency RuleCategory = "Dependency" + RuleCategoryRecommended RuleCategory = "Recommended" + RuleCategoryRequired RuleCategory = "Required" + RuleCategoryUserDefined RuleCategory = "UserDefined" +) + +// PossibleRuleCategoryValues returns the possible values for the RuleCategory const type. +func PossibleRuleCategoryValues() []RuleCategory { + return []RuleCategory{ + RuleCategoryDependency, + 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 @@ -2001,6 +3163,7 @@ type ScheduleActionType string const ( ScheduleActionTypeCreateJob ScheduleActionType = "CreateJob" + ScheduleActionTypeCreateMonitor ScheduleActionType = "CreateMonitor" ScheduleActionTypeInvokeBatchEndpoint ScheduleActionType = "InvokeBatchEndpoint" ) @@ -2008,6 +3171,7 @@ const ( func PossibleScheduleActionTypeValues() []ScheduleActionType { return []ScheduleActionType{ ScheduleActionTypeCreateJob, + ScheduleActionTypeCreateMonitor, ScheduleActionTypeInvokeBatchEndpoint, } } @@ -2124,6 +3288,49 @@ func PossibleSecretsTypeValues() []SecretsType { } } +// ServerlessEndpointState - State of the Serverless Endpoint. +type ServerlessEndpointState string + +const ( + ServerlessEndpointStateCreating ServerlessEndpointState = "Creating" + ServerlessEndpointStateCreationFailed ServerlessEndpointState = "CreationFailed" + ServerlessEndpointStateDeleting ServerlessEndpointState = "Deleting" + ServerlessEndpointStateDeletionFailed ServerlessEndpointState = "DeletionFailed" + ServerlessEndpointStateOnline ServerlessEndpointState = "Online" + ServerlessEndpointStateReinstating ServerlessEndpointState = "Reinstating" + ServerlessEndpointStateSuspended ServerlessEndpointState = "Suspended" + ServerlessEndpointStateSuspending ServerlessEndpointState = "Suspending" + ServerlessEndpointStateUnknown ServerlessEndpointState = "Unknown" +) + +// PossibleServerlessEndpointStateValues returns the possible values for the ServerlessEndpointState const type. +func PossibleServerlessEndpointStateValues() []ServerlessEndpointState { + return []ServerlessEndpointState{ + ServerlessEndpointStateCreating, + ServerlessEndpointStateCreationFailed, + ServerlessEndpointStateDeleting, + ServerlessEndpointStateDeletionFailed, + ServerlessEndpointStateOnline, + ServerlessEndpointStateReinstating, + ServerlessEndpointStateSuspended, + ServerlessEndpointStateSuspending, + ServerlessEndpointStateUnknown, + } +} + +type ServerlessInferenceEndpointAuthMode string + +const ( + ServerlessInferenceEndpointAuthModeKey ServerlessInferenceEndpointAuthMode = "Key" +) + +// PossibleServerlessInferenceEndpointAuthModeValues returns the possible values for the ServerlessInferenceEndpointAuthMode const type. +func PossibleServerlessInferenceEndpointAuthModeValues() []ServerlessInferenceEndpointAuthMode { + return []ServerlessInferenceEndpointAuthMode{ + ServerlessInferenceEndpointAuthModeKey, + } +} + type ServiceDataAccessAuthIdentity string const ( @@ -2189,6 +3396,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). @@ -2578,6 +3800,40 @@ func PossibleValueFormatValues() []ValueFormat { } } +// 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 ( + WebhookTypeAzureDevOps WebhookType = "AzureDevOps" +) + +// PossibleWebhookTypeValues returns the possible values for the WebhookType const type. +func PossibleWebhookTypeValues() []WebhookType { + return []WebhookType{ + WebhookTypeAzureDevOps, + } +} + // WeekDay - Enum of weekday type WeekDay string diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go index c3defc8f025d..8dd55fa6cc8c 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/datacontainers_client.go @@ -46,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -99,7 +99,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -120,7 +120,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -170,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +179,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -230,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,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-07-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. @@ -294,10 +294,10 @@ func (client *DataContainersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } 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 be785df97400..ccebe1ecbb78 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/datastores_client.go @@ -47,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. @@ -100,7 +100,7 @@ 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-07-01-preview") if options != nil && options.SkipValidation != nil { reqQP.Set("skipValidation", strconv.FormatBool(*options.SkipValidation)) } @@ -124,7 +124,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. @@ -174,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. @@ -234,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,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-07-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. @@ -298,10 +298,10 @@ func (client *DatastoresClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.Count != nil { reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) } @@ -311,15 +311,15 @@ func (client *DatastoresClient) listCreateRequest(ctx context.Context, resourceG if options != nil && options.Names != nil { reqQP.Set("names", strings.Join(options.Names, ",")) } - if options != nil && options.SearchText != nil { - reqQP.Set("searchText", *options.SearchText) - } if options != nil && options.OrderBy != nil { reqQP.Set("orderBy", *options.OrderBy) } if options != nil && options.OrderByAsc != nil { reqQP.Set("orderByAsc", strconv.FormatBool(*options.OrderByAsc)) } + if options != nil && options.SearchText != nil { + reqQP.Set("searchText", *options.SearchText) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Datastore name. @@ -388,9 +388,15 @@ 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-07-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/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 beb79038fb87..8ea041c147b9 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/dataversions_client.go @@ -47,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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -105,7 +105,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -126,7 +126,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -181,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Container name. @@ -246,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,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-07-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 @@ -315,19 +315,19 @@ func (client *DataVersionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") 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.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } @@ -344,3 +344,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-07-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-07-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.StatusOK, 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-07-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 fe9b6533e916..240329e1c22a 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentcontainers_client.go @@ -46,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-07-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. @@ -99,7 +99,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -120,7 +120,7 @@ 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-07-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. @@ -171,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ 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-07-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. @@ -232,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,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-07-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 @@ -297,10 +297,10 @@ func (client *EnvironmentContainersClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } 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 1b6d775fbaa6..672893392d54 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/environmentversions_client.go @@ -47,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-07-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. @@ -105,7 +105,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -126,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-07-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. @@ -182,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ 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-07-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. @@ -247,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,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-07-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. @@ -317,16 +317,16 @@ func (client *EnvironmentVersionsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") 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.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } @@ -343,3 +343,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-07-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-07-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.StatusOK, 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-07-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 index 3182bde71a27..3143e8b589cd 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchdeployments_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchdeployments_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go index a3936c8131ce..df27032f5140 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/batchendpoints_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go index f0dd10d06e87..1e48cbe1c9ca 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codecontainers_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go index 9d3eb35b037c..8e35244bbe3d 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/codeversions_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -25,6 +25,10 @@ import ( // 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) @@ -40,6 +44,10 @@ type CodeVersionsServer struct { // 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.StatusOK, 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. @@ -49,6 +57,7 @@ func NewCodeVersionsServerTransport(srv *CodeVersionsServer) *CodeVersionsServer return &CodeVersionsServerTransport{ srv: srv, newListPager: newTracker[azfake.PagerResponder[armmachinelearning.CodeVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.CodeVersionsClientPublishResponse]](), } } @@ -57,6 +66,7 @@ func NewCodeVersionsServerTransport(srv *CodeVersionsServer) *CodeVersionsServer 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. @@ -71,6 +81,8 @@ func (c *CodeVersionsServerTransport) Do(req *http.Request) (*http.Response, err var err error switch method { + case "CodeVersionsClient.CreateOrGetStartPendingUpload": + resp, err = c.dispatchCreateOrGetStartPendingUpload(req) case "CodeVersionsClient.CreateOrUpdate": resp, err = c.dispatchCreateOrUpdate(req) case "CodeVersionsClient.Delete": @@ -79,6 +91,8 @@ func (c *CodeVersionsServerTransport) Do(req *http.Request) (*http.Response, err 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) } @@ -90,6 +104,51 @@ func (c *CodeVersionsServerTransport) Do(req *http.Request) (*http.Response, 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")} @@ -266,12 +325,24 @@ func (c *CodeVersionsServerTransport) dispatchNewListPager(req *http.Request) (* 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 { + if orderByParam != nil || topParam != nil || skipParam != nil || hashParam != nil || hashVersionParam != nil { options = &armmachinelearning.CodeVersionsClientListOptions{ - OrderBy: orderByParam, - Top: topParam, - Skip: skipParam, + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + Hash: hashParam, + HashVersion: hashVersionParam, } } resp := c.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, nameParam, options) @@ -294,3 +365,59 @@ func (c *CodeVersionsServerTransport) dispatchNewListPager(req *http.Request) (* } 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.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, 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 index c2daf08e7664..6886342d57d0 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentcontainers_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentcontainers_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go index 59ef59f2300d..d277e542a6c6 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/componentversions_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -40,6 +40,10 @@ type ComponentVersionsServer struct { // 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.StatusOK, 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. @@ -49,6 +53,7 @@ func NewComponentVersionsServerTransport(srv *ComponentVersionsServer) *Componen return &ComponentVersionsServerTransport{ srv: srv, newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ComponentVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.ComponentVersionsClientPublishResponse]](), } } @@ -57,6 +62,7 @@ func NewComponentVersionsServerTransport(srv *ComponentVersionsServer) *Componen 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. @@ -79,6 +85,8 @@ func (c *ComponentVersionsServerTransport) Do(req *http.Request) (*http.Response 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) } @@ -300,3 +308,59 @@ func (c *ComponentVersionsServerTransport) dispatchNewListPager(req *http.Reques } 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.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, 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 index 9bce329c7cce..17828aeb3057 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/compute_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/compute_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go index 52ece1728298..fd3d1ef271e9 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datacontainers_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go index 2251c3b81239..76dceb6b8a39 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/datastores_server.go @@ -16,9 +16,10 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" + "reflect" "regexp" "strconv" ) @@ -340,6 +341,10 @@ func (d *DatastoresServerTransport) dispatchListSecrets(req *http.Request) (*htt if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } + body, err := server.UnmarshalRequestAsJSON[armmachinelearning.SecretExpiry](req) + if err != nil { + return nil, err + } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err @@ -352,7 +357,13 @@ func (d *DatastoresServerTransport) dispatchListSecrets(req *http.Request) (*htt if err != nil { return nil, err } - respr, errRespr := d.srv.ListSecrets(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, nil) + var options *armmachinelearning.DatastoresClientListSecretsOptions + if !reflect.ValueOf(body).IsZero() { + options = &armmachinelearning.DatastoresClientListSecretsOptions{ + Body: &body, + } + } + respr, errRespr := d.srv.ListSecrets(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go index fa15264a6b09..72268c6c23e9 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/dataversions_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -40,6 +40,10 @@ type DataVersionsServer struct { // 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.StatusOK, 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. @@ -49,6 +53,7 @@ func NewDataVersionsServerTransport(srv *DataVersionsServer) *DataVersionsServer return &DataVersionsServerTransport{ srv: srv, newListPager: newTracker[azfake.PagerResponder[armmachinelearning.DataVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.DataVersionsClientPublishResponse]](), } } @@ -57,6 +62,7 @@ func NewDataVersionsServerTransport(srv *DataVersionsServer) *DataVersionsServer 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. @@ -79,6 +85,8 @@ func (d *DataVersionsServerTransport) Do(req *http.Request) (*http.Response, err 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) } @@ -306,3 +314,59 @@ func (d *DataVersionsServerTransport) dispatchNewListPager(req *http.Request) (* } 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.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, 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 index b54a91f46aac..0d44e8cb74ff 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentcontainers_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentcontainers_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go index f96bcb379528..e21b3f635c57 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/environmentversions_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -40,6 +40,10 @@ type EnvironmentVersionsServer struct { // 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.StatusOK, 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. @@ -49,6 +53,7 @@ func NewEnvironmentVersionsServerTransport(srv *EnvironmentVersionsServer) *Envi return &EnvironmentVersionsServerTransport{ srv: srv, newListPager: newTracker[azfake.PagerResponder[armmachinelearning.EnvironmentVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.EnvironmentVersionsClientPublishResponse]](), } } @@ -57,6 +62,7 @@ func NewEnvironmentVersionsServerTransport(srv *EnvironmentVersionsServer) *Envi 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. @@ -79,6 +85,8 @@ func (e *EnvironmentVersionsServerTransport) Do(req *http.Request) (*http.Respon 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) } @@ -300,3 +308,59 @@ func (e *EnvironmentVersionsServerTransport) dispatchNewListPager(req *http.Requ } 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.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, 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/jobs_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go index 33b292ee6017..6d53bb03f665 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/jobs_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -314,13 +314,19 @@ func (j *JobsServerTransport) dispatchNewListPager(req *http.Request) (*http.Res return nil, err } listViewTypeParam := getOptional(armmachinelearning.ListViewType(listViewTypeUnescaped)) + 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 { + if skipParam != nil || jobTypeParam != nil || tagParam != nil || listViewTypeParam != nil || propertiesParam != nil { options = &armmachinelearning.JobsClientListOptions{ Skip: skipParam, JobType: jobTypeParam, Tag: tagParam, ListViewType: listViewTypeParam, + Properties: propertiesParam, } } resp := j.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) 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/marketplacesubscriptions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/marketplacesubscriptions_server.go new file mode 100644 index 000000000000..055f943159b7 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/marketplacesubscriptions_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" +) + +// MarketplaceSubscriptionsServer is a fake server for instances of the armmachinelearning.MarketplaceSubscriptionsClient type. +type MarketplaceSubscriptionsServer struct { + // BeginCreateOrUpdate is the fake for method MarketplaceSubscriptionsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, name string, body armmachinelearning.MarketplaceSubscription, options *armmachinelearning.MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmachinelearning.MarketplaceSubscriptionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method MarketplaceSubscriptionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.MarketplaceSubscriptionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmachinelearning.MarketplaceSubscriptionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method MarketplaceSubscriptionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *armmachinelearning.MarketplaceSubscriptionsClientGetOptions) (resp azfake.Responder[armmachinelearning.MarketplaceSubscriptionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method MarketplaceSubscriptionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, workspaceName string, options *armmachinelearning.MarketplaceSubscriptionsClientListOptions) (resp azfake.PagerResponder[armmachinelearning.MarketplaceSubscriptionsClientListResponse]) +} + +// NewMarketplaceSubscriptionsServerTransport creates a new instance of MarketplaceSubscriptionsServerTransport with the provided implementation. +// The returned MarketplaceSubscriptionsServerTransport instance is connected to an instance of armmachinelearning.MarketplaceSubscriptionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewMarketplaceSubscriptionsServerTransport(srv *MarketplaceSubscriptionsServer) *MarketplaceSubscriptionsServerTransport { + return &MarketplaceSubscriptionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armmachinelearning.MarketplaceSubscriptionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armmachinelearning.MarketplaceSubscriptionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armmachinelearning.MarketplaceSubscriptionsClientListResponse]](), + } +} + +// MarketplaceSubscriptionsServerTransport connects instances of armmachinelearning.MarketplaceSubscriptionsClient to instances of MarketplaceSubscriptionsServer. +// Don't use this type directly, use NewMarketplaceSubscriptionsServerTransport instead. +type MarketplaceSubscriptionsServerTransport struct { + srv *MarketplaceSubscriptionsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armmachinelearning.MarketplaceSubscriptionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armmachinelearning.MarketplaceSubscriptionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armmachinelearning.MarketplaceSubscriptionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for MarketplaceSubscriptionsServerTransport. +func (m *MarketplaceSubscriptionsServerTransport) 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 "MarketplaceSubscriptionsClient.BeginCreateOrUpdate": + resp, err = m.dispatchBeginCreateOrUpdate(req) + case "MarketplaceSubscriptionsClient.BeginDelete": + resp, err = m.dispatchBeginDelete(req) + case "MarketplaceSubscriptionsClient.Get": + resp, err = m.dispatchGet(req) + case "MarketplaceSubscriptionsClient.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 *MarketplaceSubscriptionsServerTransport) 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~%@]+)/marketplaceSubscriptions/(?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.MarketplaceSubscription](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.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, 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.StatusCreated}, resp.StatusCode) { + m.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) { + m.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (m *MarketplaceSubscriptionsServerTransport) 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~%@]+)/marketplaceSubscriptions/(?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.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nameParam, 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.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + m.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + m.beginDelete.remove(req) + } + + return resp, nil +} + +func (m *MarketplaceSubscriptionsServerTransport) 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~%@]+)/marketplaceSubscriptions/(?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).MarketplaceSubscription, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MarketplaceSubscriptionsServerTransport) 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~%@]+)/marketplaceSubscriptions` + 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.MarketplaceSubscriptionsClientListOptions + if skipParam != nil { + options = &armmachinelearning.MarketplaceSubscriptionsClientListOptions{ + Skip: skipParam, + } + } + resp := m.srv.NewListPager(resourceGroupNameParam, workspaceNameParam, options) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armmachinelearning.MarketplaceSubscriptionsClientListResponse, 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 index 486d04efb5a1..2402319cbb93 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelcontainers_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelcontainers_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go index 1d4b7761978f..7f05487485bf 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/modelversions_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -40,6 +40,10 @@ type ModelVersionsServer struct { // 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]) + + // BeginPublish is the fake for method ModelVersionsClient.BeginPublish + // HTTP status codes to indicate success: http.StatusOK, 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. @@ -49,6 +53,7 @@ func NewModelVersionsServerTransport(srv *ModelVersionsServer) *ModelVersionsSer return &ModelVersionsServerTransport{ srv: srv, newListPager: newTracker[azfake.PagerResponder[armmachinelearning.ModelVersionsClientListResponse]](), + beginPublish: newTracker[azfake.PollerResponder[armmachinelearning.ModelVersionsClientPublishResponse]](), } } @@ -57,6 +62,7 @@ func NewModelVersionsServerTransport(srv *ModelVersionsServer) *ModelVersionsSer type ModelVersionsServerTransport struct { srv *ModelVersionsServer newListPager *tracker[azfake.PagerResponder[armmachinelearning.ModelVersionsClientListResponse]] + beginPublish *tracker[azfake.PollerResponder[armmachinelearning.ModelVersionsClientPublishResponse]] } // Do implements the policy.Transporter interface for ModelVersionsServerTransport. @@ -79,6 +85,8 @@ func (m *ModelVersionsServerTransport) Do(req *http.Request) (*http.Response, er resp, err = m.dispatchGet(req) case "ModelVersionsClient.NewListPager": resp, err = m.dispatchNewListPager(req) + case "ModelVersionsClient.BeginPublish": + resp, err = m.dispatchBeginPublish(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -345,3 +353,59 @@ func (m *ModelVersionsServerTransport) dispatchNewListPager(req *http.Request) ( } 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.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginPublish.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, 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 index 34f0da39d3e4..167527d7a6c8 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlinedeployments_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlinedeployments_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go index 181353c2000d..25e207f398cb 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/onlineendpoints_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go index 4ecf37a3239a..bc514fbf6300 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/operations_server.go @@ -14,7 +14,7 @@ import ( 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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" ) diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go index e4b6cda79dcd..e3a1d824c80c 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privateendpointconnections_server.go @@ -15,7 +15,7 @@ import ( 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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go index 956d3d35983f..715e473ae328 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/privatelinkresources_server.go @@ -15,7 +15,7 @@ import ( 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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go index 1a47ba12fb7e..7542bd484c84 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/quotas_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" 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..62b09732bc7a --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrycomponentversions_server.go @@ -0,0 +1,322 @@ +//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) + var options *armmachinelearning.RegistryComponentVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil { + options = &armmachinelearning.RegistryComponentVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + } + } + 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..b62cc57915d3 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registryenvironmentversions_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" +) + +// 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)) + var options *armmachinelearning.RegistryEnvironmentVersionsClientListOptions + if orderByParam != nil || topParam != nil || skipParam != nil || listViewTypeParam != nil { + options = &armmachinelearning.RegistryEnvironmentVersionsClientListOptions{ + OrderBy: orderByParam, + Top: topParam, + Skip: skipParam, + ListViewType: listViewTypeParam, + } + } + 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..5188cda29468 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/registrymodelversions_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" +) + +// 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]) +} + +// 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]](), + } +} + +// 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]] +} + +// 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) + 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 +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go index 424cabea6a4d..ffe3f67da2d2 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/schedules_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go index efbbde03986d..ce69958d1713 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/server_factory.go @@ -19,33 +19,54 @@ import ( // ServerFactory is a fake server for instances of the armmachinelearning.ClientFactory type. type ServerFactory struct { - BatchDeploymentsServer BatchDeploymentsServer - BatchEndpointsServer BatchEndpointsServer - CodeContainersServer CodeContainersServer - CodeVersionsServer CodeVersionsServer - ComponentContainersServer ComponentContainersServer - ComponentVersionsServer ComponentVersionsServer - ComputeServer ComputeServer - DataContainersServer DataContainersServer - DataVersionsServer DataVersionsServer - DatastoresServer DatastoresServer - EnvironmentContainersServer EnvironmentContainersServer - EnvironmentVersionsServer EnvironmentVersionsServer - JobsServer JobsServer - ModelContainersServer ModelContainersServer - ModelVersionsServer ModelVersionsServer - OnlineDeploymentsServer OnlineDeploymentsServer - OnlineEndpointsServer OnlineEndpointsServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - QuotasServer QuotasServer - SchedulesServer SchedulesServer - UsagesServer UsagesServer - VirtualMachineSizesServer VirtualMachineSizesServer - WorkspaceConnectionsServer WorkspaceConnectionsServer - WorkspaceFeaturesServer WorkspaceFeaturesServer - WorkspacesServer WorkspacesServer + BatchDeploymentsServer BatchDeploymentsServer + BatchEndpointsServer BatchEndpointsServer + 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 + JobsServer JobsServer + ManagedNetworkProvisionsServer ManagedNetworkProvisionsServer + ManagedNetworkSettingsRuleServer ManagedNetworkSettingsRuleServer + MarketplaceSubscriptionsServer MarketplaceSubscriptionsServer + 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. @@ -60,35 +81,56 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // 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 - trCodeContainersServer *CodeContainersServerTransport - trCodeVersionsServer *CodeVersionsServerTransport - trComponentContainersServer *ComponentContainersServerTransport - trComponentVersionsServer *ComponentVersionsServerTransport - trComputeServer *ComputeServerTransport - trDataContainersServer *DataContainersServerTransport - trDataVersionsServer *DataVersionsServerTransport - trDatastoresServer *DatastoresServerTransport - trEnvironmentContainersServer *EnvironmentContainersServerTransport - trEnvironmentVersionsServer *EnvironmentVersionsServerTransport - trJobsServer *JobsServerTransport - trModelContainersServer *ModelContainersServerTransport - trModelVersionsServer *ModelVersionsServerTransport - trOnlineDeploymentsServer *OnlineDeploymentsServerTransport - trOnlineEndpointsServer *OnlineEndpointsServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQuotasServer *QuotasServerTransport - trSchedulesServer *SchedulesServerTransport - trUsagesServer *UsagesServerTransport - trVirtualMachineSizesServer *VirtualMachineSizesServerTransport - trWorkspaceConnectionsServer *WorkspaceConnectionsServerTransport - trWorkspaceFeaturesServer *WorkspaceFeaturesServerTransport - trWorkspacesServer *WorkspacesServerTransport + srv *ServerFactory + trMu sync.Mutex + trBatchDeploymentsServer *BatchDeploymentsServerTransport + trBatchEndpointsServer *BatchEndpointsServerTransport + 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 + trJobsServer *JobsServerTransport + trManagedNetworkProvisionsServer *ManagedNetworkProvisionsServerTransport + trManagedNetworkSettingsRuleServer *ManagedNetworkSettingsRuleServerTransport + trMarketplaceSubscriptionsServer *MarketplaceSubscriptionsServerTransport + 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. @@ -156,9 +198,47 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { 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 "JobsClient": initServer(s, &s.trJobsServer, func() *JobsServerTransport { return NewJobsServerTransport(&s.srv.JobsServer) }) resp, err = s.trJobsServer.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 "MarketplaceSubscriptionsClient": + initServer(s, &s.trMarketplaceSubscriptionsServer, func() *MarketplaceSubscriptionsServerTransport { + return NewMarketplaceSubscriptionsServerTransport(&s.srv.MarketplaceSubscriptionsServer) + }) + resp, err = s.trMarketplaceSubscriptionsServer.Do(req) case "ModelContainersClient": initServer(s, &s.trModelContainersServer, func() *ModelContainersServerTransport { return NewModelContainersServerTransport(&s.srv.ModelContainersServer) @@ -195,9 +275,72 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { 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) 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..6d310a218532 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/serverlessendpoints_server.go @@ -0,0 +1,447 @@ +//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.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) + + // 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.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.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are 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) 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 index b0535a7b63e6..81f308b0d343 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/time_rfc3339.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // 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+)*"*$`) +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 + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go index 00049146c50d..d4f9349cf140 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/usages_server.go @@ -15,7 +15,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go index c3bd8df564d7..7df82b07e0de 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/virtualmachinesizes_server.go @@ -15,7 +15,7 @@ import ( 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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go index 7518f6d867b0..44cd462b4d14 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaceconnections_server.go @@ -16,7 +16,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" @@ -39,6 +39,10 @@ type WorkspaceConnectionsServer struct { // 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) } // NewWorkspaceConnectionsServerTransport creates a new instance of WorkspaceConnectionsServerTransport with the provided implementation. @@ -78,6 +82,8 @@ func (w *WorkspaceConnectionsServerTransport) Do(req *http.Request) (*http.Respo resp, err = w.dispatchGet(req) case "WorkspaceConnectionsClient.NewListPager": resp, err = w.dispatchNewListPager(req) + case "WorkspaceConnectionsClient.ListSecrets": + resp, err = w.dispatchListSecrets(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -262,3 +268,40 @@ func (w *WorkspaceConnectionsServerTransport) dispatchNewListPager(req *http.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) + } + 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.ListSecrets(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}, 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 index 36efb84fdfcf..4d56bffe84c0 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspacefeatures_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspacefeatures_server.go @@ -15,7 +15,7 @@ import ( "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/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go index 6b2eeb506239..642cb0aee822 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/fake/workspaces_server.go @@ -16,11 +16,12 @@ import ( "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/v3" + "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. @@ -224,6 +225,7 @@ func (w *WorkspacesServerTransport) dispatchBeginDelete(req *http.Request) (*htt 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 @@ -232,7 +234,21 @@ func (w *WorkspacesServerTransport) dispatchBeginDelete(req *http.Request) (*htt if err != nil { return nil, err } - respr, errRespr := w.srv.BeginDelete(req.Context(), resourceGroupNameParam, workspaceNameParam, nil) + 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 } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/features_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/features_client.go new file mode 100644 index 000000000000..e41dc72ccd6f --- /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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.Description != nil { + reqQP.Set("description", *options.Description) + } + if options != nil && options.FeatureName != nil { + reqQP.Set("featureName", *options.FeatureName) + } + 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.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + 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..b2d93e5e1523 --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + 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.Name != nil { + reqQP.Set("name", *options.Name) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + 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..1c057ff48fd3 --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + 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)) + } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + if options != nil && options.VersionName != nil { + reqQP.Set("versionName", *options.VersionName) + } + 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..46a60a114fa1 --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + 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.Name != nil { + reqQP.Set("name", *options.Name) + } + if options != nil && options.PageSize != nil { + reqQP.Set("pageSize", strconv.FormatInt(int64(*options.PageSize), 10)) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + 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..3afd4dbfd89e --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.CreatedBy != nil { + reqQP.Set("createdBy", *options.CreatedBy) + } + 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)) + } + if options != nil && options.Stage != nil { + reqQP.Set("stage", *options.Stage) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + if options != nil && options.VersionName != nil { + reqQP.Set("versionName", *options.VersionName) + } + 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 1e049cb08183..b0f5a6b16a1f 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.12.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.24.0 // indirect golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum b/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum index e8d8068ae2d8..6b8c4a4ad083 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0/go.mod h1:99EvauvlcJ1U06amZiksfYz/3aFGyIhWGHVyiZXtBAI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0 h1:U2rTu3Ef+7w9FHKIAXM6ZyqF3UOWJZ12zIm8zECAFfg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0 h1:H+U3Gk9zY56G3u872L82bk4thcsy2Gghb9ExT4Zvm1o= github.com/Azure/azure-sdk-for-go/sdk/internal v1.9.0/go.mod h1:mgrmMSgaLp9hmax62XQTd0N4aAqSE5E0DulSpVYK7vc= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go b/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go index 149a1ae9b1cc..e9f57c877959 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/interfaces.go @@ -27,6 +27,15 @@ type AutoMLVerticalClassification interface { GetAutoMLVertical() *AutoMLVertical } +// 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: @@ -46,6 +55,33 @@ type ComputeSecretsClassification interface { 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 +} + +// 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: @@ -68,7 +104,8 @@ type DatastoreCredentialsClassification interface { // 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 +// - *AzureBlobDatastore, *AzureDataLakeGen1Datastore, *AzureDataLakeGen2Datastore, *AzureFileDatastore, *DatastoreProperties, +// - *OneLakeDatastore type DatastorePropertiesClassification interface { // GetDatastoreProperties returns the DatastoreProperties content of the underlying type. GetDatastoreProperties() *DatastoreProperties @@ -122,7 +159,7 @@ type IdentityConfigurationClassification interface { // 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 +// - *AutoMLJob, *CommandJob, *JobBaseProperties, *PipelineJob, *SparkJob, *SweepJob type JobBasePropertiesClassification interface { // GetJobBaseProperties returns the JobBaseProperties content of the underlying type. GetJobBaseProperties() *JobBaseProperties @@ -157,6 +194,52 @@ type JobOutputClassification interface { GetJobOutput() *JobOutput } +// 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, +// - *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: @@ -166,6 +249,24 @@ type NCrossValidationsClassification interface { 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: @@ -184,6 +285,33 @@ type OnlineScaleSettingsClassification interface { 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 +} + +// 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: @@ -196,7 +324,7 @@ type SamplingAlgorithmClassification interface { // 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 +// - *CreateMonitorAction, *EndpointScheduleAction, *JobScheduleAction, *ScheduleActionBase type ScheduleActionBaseClassification interface { // GetScheduleActionBase returns the ScheduleActionBase content of the underlying type. GetScheduleActionBase() *ScheduleActionBase @@ -211,6 +339,15 @@ type SeasonalityClassification interface { 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: @@ -238,11 +375,23 @@ type TriggerBaseClassification interface { 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: -// - *ManagedIdentityAuthTypeWorkspaceConnectionProperties, *NoneAuthTypeWorkspaceConnectionProperties, *PATAuthTypeWorkspaceConnectionProperties, -// - *SASAuthTypeWorkspaceConnectionProperties, *UsernamePasswordAuthTypeWorkspaceConnectionProperties, *WorkspaceConnectionPropertiesV2 +// - *AADAuthTypeWorkspaceConnectionProperties, *APIKeyAuthWorkspaceConnectionProperties, *AccessKeyAuthTypeWorkspaceConnectionProperties, +// - *AccountKeyAuthTypeWorkspaceConnectionProperties, *CustomKeysWorkspaceConnectionProperties, *ManagedIdentityAuthTypeWorkspaceConnectionProperties, +// - *NoneAuthTypeWorkspaceConnectionProperties, *OAuth2AuthTypeWorkspaceConnectionProperties, *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 96d041587e6b..a2d6ed34b56a 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/jobs_client.go @@ -46,7 +46,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-07-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. @@ -72,7 +72,7 @@ func (client *JobsClient) BeginCancel(ctx context.Context, resourceGroupName str // 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-07-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" @@ -118,16 +118,17 @@ 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-07-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-07-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. @@ -179,7 +180,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -200,7 +201,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-07-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. @@ -212,7 +213,8 @@ func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName str return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JobsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -225,7 +227,7 @@ func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName str // 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-07-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" @@ -271,7 +273,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +282,7 @@ 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-07-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. @@ -331,7 +333,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +350,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-07-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. @@ -395,19 +397,22 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.JobType != nil { reqQP.Set("jobType", *options.JobType) } - if options != nil && options.Tag != nil { - reqQP.Set("tag", *options.Tag) - } if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } + if options != nil && options.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.Tag != nil { + reqQP.Set("tag", *options.Tag) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, 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/managednetworkprovisions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworkprovisions_client.go new file mode 100644 index 000000000000..51b14036a7a1 --- /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-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - 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-07-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-07-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..1ec0e3344df2 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/managednetworksettingsrule_client.go @@ -0,0 +1,346 @@ +//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-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - 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-07-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-07-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-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - 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]{ + 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-07-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-07-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-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - 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-07-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-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - 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-07-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/marketplacesubscriptions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/marketplacesubscriptions_client.go new file mode 100644 index 000000000000..17e4bf087ff4 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/marketplacesubscriptions_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" +) + +// MarketplaceSubscriptionsClient contains the methods for the MarketplaceSubscriptions group. +// Don't use this type directly, use NewMarketplaceSubscriptionsClient() instead. +type MarketplaceSubscriptionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewMarketplaceSubscriptionsClient creates a new instance of MarketplaceSubscriptionsClient 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 NewMarketplaceSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MarketplaceSubscriptionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &MarketplaceSubscriptionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update Marketplace Subscription (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Marketplace Subscription name. +// - body - Marketplace Subscription entity to apply during operation. +// - options - MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the MarketplaceSubscriptionsClient.BeginCreateOrUpdate +// method. +func (client *MarketplaceSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body MarketplaceSubscription, options *MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[MarketplaceSubscriptionsClientCreateOrUpdateResponse], 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[MarketplaceSubscriptionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MarketplaceSubscriptionsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update Marketplace Subscription (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01-preview +func (client *MarketplaceSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, name string, body MarketplaceSubscription, options *MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "MarketplaceSubscriptionsClient.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 *MarketplaceSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, body MarketplaceSubscription, options *MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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-07-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 Marketplace Subscription (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - name - Marketplace Subscription name. +// - options - MarketplaceSubscriptionsClientBeginDeleteOptions contains the optional parameters for the MarketplaceSubscriptionsClient.BeginDelete +// method. +func (client *MarketplaceSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *MarketplaceSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[MarketplaceSubscriptionsClientDeleteResponse], 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[MarketplaceSubscriptionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MarketplaceSubscriptionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete Marketplace Subscription (asynchronous). +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01-preview +func (client *MarketplaceSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *MarketplaceSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "MarketplaceSubscriptionsClient.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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *MarketplaceSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *MarketplaceSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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-07-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-07-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 - MarketplaceSubscriptionsClientGetOptions contains the optional parameters for the MarketplaceSubscriptionsClient.Get +// method. +func (client *MarketplaceSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *MarketplaceSubscriptionsClientGetOptions) (MarketplaceSubscriptionsClientGetResponse, error) { + var err error + const operationName = "MarketplaceSubscriptionsClient.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 MarketplaceSubscriptionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MarketplaceSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MarketplaceSubscriptionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *MarketplaceSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, options *MarketplaceSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{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-07-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 *MarketplaceSubscriptionsClient) getHandleResponse(resp *http.Response) (MarketplaceSubscriptionsClientGetResponse, error) { + result := MarketplaceSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MarketplaceSubscription); err != nil { + return MarketplaceSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List containers. +// +// Generated from API version 2024-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - options - MarketplaceSubscriptionsClientListOptions contains the optional parameters for the MarketplaceSubscriptionsClient.NewListPager +// method. +func (client *MarketplaceSubscriptionsClient) NewListPager(resourceGroupName string, workspaceName string, options *MarketplaceSubscriptionsClientListOptions) *runtime.Pager[MarketplaceSubscriptionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[MarketplaceSubscriptionsClientListResponse]{ + More: func(page MarketplaceSubscriptionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MarketplaceSubscriptionsClientListResponse) (MarketplaceSubscriptionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MarketplaceSubscriptionsClient.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 MarketplaceSubscriptionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *MarketplaceSubscriptionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *MarketplaceSubscriptionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions" + 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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-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 *MarketplaceSubscriptionsClient) listHandleResponse(resp *http.Response) (MarketplaceSubscriptionsClientListResponse, error) { + result := MarketplaceSubscriptionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MarketplaceSubscriptionResourceArmPaginatedResult); err != nil { + return MarketplaceSubscriptionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go index 7ead9acd7ccf..81f5d50475c7 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/modelcontainers_client.go @@ -47,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-07-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. @@ -100,7 +100,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -121,7 +121,7 @@ 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-07-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. @@ -171,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ 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-07-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. @@ -231,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,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-07-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 @@ -296,10 +296,10 @@ func (client *ModelContainersClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.Count != nil { reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) } 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 fc2be571ee53..4e74125b0b1c 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/models.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/models.go @@ -10,6 +10,51 @@ package armmachinelearning import "time" +// AADAuthTypeWorkspaceConnectionProperties - This connection type covers the AAD auth for any applicable Azure service +type AADAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type AADAuthTypeWorkspaceConnectionProperties. +func (a *AADAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: a.AuthType, + Category: a.Category, + CreatedByWorkspaceArmID: a.CreatedByWorkspaceArmID, + ExpiryTime: a.ExpiryTime, + Group: a.Group, + IsSharedToAll: a.IsSharedToAll, + Metadata: a.Metadata, + SharedUserList: a.SharedUserList, + Target: a.Target, + Value: a.Value, + ValueFormat: a.ValueFormat, + } +} + // AKS - A Machine Learning compute based on AKS. type AKS struct { // REQUIRED; The type of compute @@ -98,6 +143,154 @@ 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 + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// 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, + Group: a.Group, + IsSharedToAll: a.IsSharedToAll, + Metadata: a.Metadata, + SharedUserList: a.SharedUserList, + Target: a.Target, + Value: a.Value, + ValueFormat: a.ValueFormat, + } +} + +type AccessKeyAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + Credentials *WorkspaceConnectionAccessKey + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// 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, + Group: a.Group, + IsSharedToAll: a.IsSharedToAll, + Metadata: a.Metadata, + SharedUserList: a.SharedUserList, + Target: a.Target, + Value: a.Value, + ValueFormat: a.ValueFormat, + } +} + +// AccountKeyAuthTypeWorkspaceConnectionProperties - This connection type covers the account key connection for Azure storage +type AccountKeyAuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + Credentials *WorkspaceConnectionAccountKey + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type AccountKeyAuthTypeWorkspaceConnectionProperties. +func (a *AccountKeyAuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: a.AuthType, + Category: a.Category, + CreatedByWorkspaceArmID: a.CreatedByWorkspaceArmID, + ExpiryTime: a.ExpiryTime, + Group: a.Group, + IsSharedToAll: a.IsSharedToAll, + Metadata: a.Metadata, + SharedUserList: a.SharedUserList, + Target: a.Target, + Value: a.Value, + ValueFormat: a.ValueFormat, + } +} + // AccountKeyDatastoreCredentials - Account key datastore credentials configuration. type AccountKeyDatastoreCredentials struct { // REQUIRED; [Required] Credential type used to authentication with storage. @@ -130,6 +323,15 @@ 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 +} + // AksComputeSecrets - Secrets related to a Machine Learning compute based on AKS. type AksComputeSecrets struct { // REQUIRED; The type of compute @@ -181,6 +383,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 @@ -336,39 +563,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. @@ -382,6 +576,19 @@ func (a *AmlToken) GetIdentityConfiguration() *IdentityConfiguration { } } +// AmlTokenComputeIdentity - AML token compute identity definition. +type AmlTokenComputeIdentity struct { + // REQUIRED; [Required] Specifies the type of identity to use within the monitoring jobs. + 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 @@ -394,6 +601,27 @@ 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 { // The asset description text. Description *string @@ -519,12 +747,18 @@ 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 @@ -541,18 +775,19 @@ type AutoMLJob struct { // GetJobBaseProperties implements the JobBasePropertiesClassification interface for type AutoMLJob. func (a *AutoMLJob) GetJobBaseProperties() *JobBaseProperties { return &JobBaseProperties{ - ComponentID: a.ComponentID, - ComputeID: a.ComputeID, - Description: a.Description, - DisplayName: a.DisplayName, - ExperimentName: a.ExperimentName, - Identity: a.Identity, - IsArchived: a.IsArchived, - JobType: a.JobType, - Properties: a.Properties, - Services: a.Services, - Status: a.Status, - Tags: a.Tags, + 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, + Services: a.Services, + Status: a.Status, + Tags: a.Tags, } } @@ -663,9 +898,15 @@ type AzureBlobDatastore struct { // 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 @@ -702,9 +943,15 @@ type AzureDataLakeGen1Datastore struct { // 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 @@ -750,9 +997,15 @@ type AzureDataLakeGen2Datastore struct { // 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 @@ -772,6 +1025,32 @@ func (a *AzureDataLakeGen2Datastore) GetDatastoreProperties() *DatastoreProperti } } +// 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, + } +} + // AzureFileDatastore - Azure File datastore configuration. type AzureFileDatastore struct { // REQUIRED; [Required] Storage account name. @@ -798,9 +1077,15 @@ type AzureFileDatastore struct { // 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 @@ -879,6 +1164,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. @@ -887,6 +1183,9 @@ 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 @@ -1020,6 +1319,31 @@ type BatchEndpointTrackedResourceArmPaginatedResult struct { Value []*BatchEndpoint } +// BatchPipelineComponentDeploymentConfiguration - Properties for a Batch Pipeline Component Deployment. +type BatchPipelineComponentDeploymentConfiguration struct { + // REQUIRED; [Required] The type of the deployment + DeploymentConfigurationType *BatchDeploymentConfigurationType + + // The ARM id of the component to be run. + ComponentID *IDAssetReference + + // The description which will be applied to the job. + Description *string + + // Run-time settings for the pipeline job. + Settings map[string]*string + + // The tags which will be applied to the job. + Tags map[string]*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. type BatchRetrySettings struct { // Maximum retry count for a mini-batch @@ -1042,6 +1366,29 @@ func (b *BayesianSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { } } +// BindOptions - Describes the bind options for the container +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 @@ -1052,6 +1399,64 @@ type BuildContext struct { DockerfilePath *string } +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. @@ -1253,6 +1658,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. @@ -1301,6 +1709,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. @@ -1312,6 +1723,22 @@ type CodeVersionResourceArmPaginatedResult struct { Value []*CodeVersion } +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 + + // Enable or disable data collection. + DataCollectionMode *DataCollectionMode + + // 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 + + // The sampling rate for collection. Sampling rate 1.0 means we collect 100% of data by default. + SamplingRate *float64 +} + // ColumnTransformer - Column transformer parameters. type ColumnTransformer struct { // Fields to apply transformer logic on. @@ -1369,12 +1796,18 @@ 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 @@ -1394,18 +1827,19 @@ type CommandJob struct { // GetJobBaseProperties implements the JobBasePropertiesClassification interface for type CommandJob. func (c *CommandJob) GetJobBaseProperties() *JobBaseProperties { return &JobBaseProperties{ - ComponentID: c.ComponentID, - ComputeID: c.ComputeID, - Description: c.Description, - DisplayName: c.DisplayName, - ExperimentName: c.ExperimentName, - Identity: c.Identity, - IsArchived: c.IsArchived, - JobType: c.JobType, - Properties: c.Properties, - Services: c.Services, - Status: c.Status, - 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, + Services: c.Services, + Status: c.Status, + Tags: c.Tags, } } @@ -1464,6 +1898,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. @@ -1512,6 +1949,9 @@ type ComponentVersionProperties struct { // 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. @@ -1743,6 +2183,9 @@ type ComputeInstanceProperties struct { // 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. @@ -1754,6 +2197,9 @@ type ComputeInstanceProperties struct { // 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 @@ -1787,8 +2233,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 @@ -1826,6 +2272,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. @@ -1861,6 +2321,11 @@ type ComputeResourceSchema struct { Properties ComputeClassification } +// ComputeRuntimeDto - Compute runtime config for feature store type workspace. +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. @@ -1882,10 +2347,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 @@ -1894,7 +2359,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 @@ -1923,11 +2388,44 @@ type ContainerResourceSettings struct { Memory *string } +type ContentSafety struct { + // REQUIRED; [Required] Specifies the status of content safety. + ContentSafetyStatus *ContentSafetyStatus +} + 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 @@ -1974,11 +2472,75 @@ func (c *CustomForecastHorizon) GetForecastHorizon() *ForecastHorizon { } } -type CustomModelJobInput struct { - // REQUIRED; [Required] Specifies the type of job. - JobInputType *JobInputType +// CustomKeys - Custom Keys credential object +type CustomKeys struct { + // Dictionary of + Keys map[string]*string +} - // REQUIRED; [Required] Input Asset URI. +// 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 + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// 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, + Group: c.Group, + IsSharedToAll: c.IsSharedToAll, + Metadata: c.Metadata, + SharedUserList: c.SharedUserList, + Target: c.Target, + Value: c.Value, + ValueFormat: c.ValueFormat, + } +} + +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 // Description for the input. @@ -2018,6 +2580,38 @@ func (c *CustomModelJobOutput) GetJobOutput() *JobOutput { } } +type CustomMonitoringSignal struct { + // REQUIRED; [Required] Reference to the component asset 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 +} + +// 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. @@ -2049,6 +2643,30 @@ 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 + + // 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 @@ -2079,6 +2697,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. @@ -2130,6 +2766,57 @@ type DataContainerResourceArmPaginatedResult struct { Value []*DataContainer } +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 +} + +// GetDataDriftMetricThresholdBase implements the DataDriftMetricThresholdBaseClassification interface for type DataDriftMetricThresholdBase. +func (d *DataDriftMetricThresholdBase) GetDataDriftMetricThresholdBase() *DataDriftMetricThresholdBase { + return d +} + +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 + + // 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 +} + +// 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. type DataFactory struct { // REQUIRED; The type of compute @@ -2259,6 +2946,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. @@ -2282,7 +3029,7 @@ 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 // The asset description text. @@ -2509,6 +3256,18 @@ type DeploymentResourceConfiguration struct { 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 @@ -2583,6 +3342,34 @@ func (d *DistributionConfiguration) GetDistributionConfiguration() *Distribution return d } +// Docker container configuration +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 type EarlyTerminationPolicy struct { // REQUIRED; [Required] Name of policy configuration @@ -2609,6 +3396,11 @@ type EncryptionKeyVaultProperties struct { IdentityClientID *string } +type EncryptionKeyVaultUpdateProperties struct { + // REQUIRED + KeyIdentifier *string +} + type EncryptionProperty struct { // REQUIRED; Customer Key vault properties. KeyVaultProperties *EncryptionKeyVaultProperties @@ -2620,6 +3412,29 @@ type EncryptionProperty struct { Identity *IdentityForCmk } +type EncryptionUpdateProperties struct { + // REQUIRED + KeyVaultProperties *EncryptionKeyVaultUpdateProperties +} + +// Endpoint - Describes the endpoint configuration for the container +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. type EndpointAuthKeys struct { // The primary key. @@ -2737,6 +3552,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. @@ -2748,6 +3566,18 @@ type EnvironmentContainerResourceArmPaginatedResult struct { Value []*EnvironmentContainer } +// EnvironmentVariable - Environment Variables for the container +type EnvironmentVariable struct { + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any + + // Type of the Environment Variable. Possible values are: local - For local variable + Type *EnvironmentVariableType + + // Value of the Environment variable + Value *string +} + // EnvironmentVersion - Azure Resource Manager resource envelope. type EnvironmentVersion struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -2798,11 +3628,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. @@ -2894,116 +3730,531 @@ type FQDNEndpointsProperties struct { Endpoints []*FQDNEndpoint } -// FeaturizationSettings - Featurization Configuration. -type FeaturizationSettings struct { - // Dataset language, useful for the text data. - DatasetLanguage *string -} +// Feature - Azure Resource Manager resource envelope. +type Feature struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *FeatureProperties -type FlavorData struct { - // Model flavor-specific data. - Data map[string]*string -} + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string -// ForecastHorizon - The desired maximum forecast horizon in units of time-series frequency. -type ForecastHorizon struct { - // REQUIRED; [Required] Set forecast horizon value selection mode. - Mode *ForecastHorizonMode + // 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 } -// GetForecastHorizon implements the ForecastHorizonClassification interface for type ForecastHorizon. -func (f *ForecastHorizon) GetForecastHorizon() *ForecastHorizon { return f } +type FeatureAttributionDriftMonitoringSignal struct { + // REQUIRED; [Required] The settings for computing feature importance. + FeatureImportanceSettings *FeatureImportanceSettings -// Forecasting task in AutoML Table vertical. -type Forecasting struct { - // REQUIRED; [Required] Task type for AutoMLJob. - TaskType *TaskType + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThreshold *FeatureAttributionMetricThreshold - // REQUIRED; [Required] Training data input. - TrainingData *MLTableJobInput + // REQUIRED; [Required] The data which drift will be calculated for. + ProductionData []MonitoringInputDataBaseClassification - // Columns to use for CVSplit data. - CvSplitColumnNames []*string + // REQUIRED; [Required] The data to calculate drift against. + ReferenceData MonitoringInputDataBaseClassification - // Featurization inputs needed for AutoML job. - FeaturizationSettings *TableVerticalFeaturizationSettings + // REQUIRED; [Required] Specifies the type of signal to monitor. + SignalType *MonitoringSignalType - // Forecasting task specific inputs. - ForecastingSettings *ForecastingSettings + // A dictionary that maps feature names to their respective data types. + FeatureDataTypeOverride map[string]*MonitoringFeatureDataType - // Execution constraints for AutoMLJob. - LimitSettings *TableVerticalLimitSettings + // The current notification mode for this signal. + NotificationTypes []*MonitoringNotificationType - // Log verbosity for the job. - LogVerbosity *LogVerbosity + // Property dictionary. Properties can be added, but not removed or altered. + Properties map[string]*string +} - // Number of cross validation folds to be applied on training dataset when validation dataset is not provided. - NCrossValidations NCrossValidationsClassification +// GetMonitoringSignalBase implements the MonitoringSignalBaseClassification interface for type FeatureAttributionDriftMonitoringSignal. +func (f *FeatureAttributionDriftMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: f.NotificationTypes, + Properties: f.Properties, + SignalType: f.SignalType, + } +} - // Primary metric for forecasting task. - PrimaryMetric *ForecastingPrimaryMetrics +type FeatureAttributionMetricThreshold struct { + // REQUIRED; [Required] The feature attribution metric to calculate. + Metric *FeatureAttributionMetric - // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. - TargetColumnName *string + // The threshold value. If null, a default value will be set depending on the selected metric. + Threshold *MonitoringThreshold +} - // Test data input. - TestData *MLTableJobInput +type FeatureImportanceSettings struct { + // The mode of operation for computing feature importance. + Mode *FeatureImportanceMode - // The fraction of test dataset that needs to be set aside for validation purpose. Values between (0.0 , 1.0) Applied when - // validation dataset is not provided. - TestDataSize *float64 + // The name of the target column within the input data asset. + TargetColumn *string +} - // Inputs for training phase for an AutoML Job. - TrainingSettings *ForecastingTrainingSettings +// FeatureProperties - DTO object representing feature +type FeatureProperties struct { + // Specifies type + DataType *FeatureDataType - // Validation data inputs. - ValidationData *MLTableJobInput + // The asset description text. + Description *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 + // Specifies name + FeatureName *string - // The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to - // be weighted up or down. - WeightColumnName *string + // The asset property dictionary. + Properties map[string]*string + + // Tag dictionary. Tags can be added, removed, and updated. + Tags map[string]*string } -// GetAutoMLVertical implements the AutoMLVerticalClassification interface for type Forecasting. -func (f *Forecasting) GetAutoMLVertical() *AutoMLVertical { - return &AutoMLVertical{ - LogVerbosity: f.LogVerbosity, - TargetColumnName: f.TargetColumnName, - TaskType: f.TaskType, - TrainingData: f.TrainingData, - } +// 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 } -// ForecastingSettings - Forecasting specific parameters. -type ForecastingSettings struct { - // Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example - // 'US' or 'GB'. - CountryOrRegionForHolidays *string +// FeatureStoreSettings - Settings for feature store type workspace. +type FeatureStoreSettings struct { + // Compute runtime config for feature store type workspace. + ComputeRuntime *ComputeRuntimeDto + OfflineStoreConnectionName *string + OnlineStoreConnectionName *string +} - // Number of periods between the origin time of one CV fold and the next fold. For example, if CVStepSize = 3 for daily data, - // the origin time for each fold will be three days apart. - CvStepSize *int32 +type FeatureSubset struct { + // REQUIRED; [Required] The list of features to include. + Features []*string - // Flag for generating lags for the numeric features with 'auto' or null. - FeatureLags *FeatureLags + // REQUIRED; [Required] Specifies the feature filter to leverage when selecting features to calculate metrics over. + FilterType *MonitoringFeatureFilterType +} - // The desired maximum forecast horizon in units of time-series frequency. - ForecastHorizon ForecastHorizonClassification +// GetMonitoringFeatureFilterBase implements the MonitoringFeatureFilterBaseClassification interface for type FeatureSubset. +func (f *FeatureSubset) GetMonitoringFeatureFilterBase() *MonitoringFeatureFilterBase { + return &MonitoringFeatureFilterBase{ + FilterType: f.FilterType, + } +} - // When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, - // etc. The forecast frequency is dataset frequency by default. - Frequency *string +// FeatureWindow - Specifies the feature window +type FeatureWindow struct { + // Specifies the feature window end time + FeatureWindowEnd *time.Time - // Set time series seasonality as an integer multiple of the series frequency. If seasonality is set to 'auto', it will be - // inferred. - Seasonality SeasonalityClassification + // Specifies the feature window start time + FeatureWindowStart *time.Time +} - // The parameter defining how if AutoML should handle short time series. - ShortSeriesHandlingConfig *ShortSeriesHandlingConfiguration +// 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 { + // The asset description text. + Description *string + + // Specifies list of entities + Entities []*string + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool + + // Is the asset archived? + 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 { + // The asset description text. + Description *string + + // Specifies index columns + IndexColumns []*IndexColumn + + // If the name version are system generated (anonymous registration). + IsAnonymous *bool + + // Is the asset archived? + 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 +} + +// 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 +} + +// ForecastHorizon - The desired maximum forecast horizon in units of time-series frequency. +type ForecastHorizon struct { + // REQUIRED; [Required] Set forecast horizon value selection mode. + Mode *ForecastHorizonMode +} + +// GetForecastHorizon implements the ForecastHorizonClassification interface for type ForecastHorizon. +func (f *ForecastHorizon) GetForecastHorizon() *ForecastHorizon { return f } + +// Forecasting task in AutoML Table vertical. +type Forecasting 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 + + // Forecasting task specific inputs. + ForecastingSettings *ForecastingSettings + + // Execution constraints for AutoMLJob. + LimitSettings *TableVerticalLimitSettings + + // Log verbosity for the job. + LogVerbosity *LogVerbosity + + // Number of cross validation folds to be applied on training dataset when validation dataset is not provided. + NCrossValidations NCrossValidationsClassification + + // Primary metric for forecasting task. + PrimaryMetric *ForecastingPrimaryMetrics + + // Target column name: This is prediction values column. Also known as label column name in context of classification tasks. + TargetColumnName *string + + // Test data input. + TestData *MLTableJobInput + + // The fraction of test dataset that needs to be set aside for validation purpose. Values between (0.0 , 1.0) Applied when + // validation dataset is not provided. + TestDataSize *float64 + + // Inputs for training phase for an AutoML Job. + TrainingSettings *ForecastingTrainingSettings + + // 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 + + // The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to + // be weighted up or down. + WeightColumnName *string +} + +// GetAutoMLVertical implements the AutoMLVerticalClassification interface for type Forecasting. +func (f *Forecasting) GetAutoMLVertical() *AutoMLVertical { + return &AutoMLVertical{ + LogVerbosity: f.LogVerbosity, + TargetColumnName: f.TargetColumnName, + TaskType: f.TaskType, + TrainingData: f.TrainingData, + } +} + +// ForecastingSettings - Forecasting specific parameters. +type ForecastingSettings struct { + // Country or region for holidays for forecasting tasks. These should be ISO 3166 two-letter country/region codes, for example + // 'US' or 'GB'. + CountryOrRegionForHolidays *string + + // Number of periods between the origin time of one CV fold and the next fold. For example, if CVStepSize = 3 for daily data, + // the origin time for each fold will be three days apart. + CvStepSize *int32 + + // Flag for generating lags for the numeric features with 'auto' or null. + FeatureLags *FeatureLags + + // The desired maximum forecast horizon in units of time-series frequency. + ForecastHorizon ForecastHorizonClassification + + // When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, + // etc. The forecast frequency is dataset frequency by default. + Frequency *string + + // Set time series seasonality as an integer multiple of the series frequency. If seasonality is set to 'auto', it will be + // inferred. + Seasonality SeasonalityClassification + + // The parameter defining how if AutoML should handle short time series. + ShortSeriesHandlingConfig *ShortSeriesHandlingConfiguration // The function to be used to aggregate the time series target column to conform to a user specified frequency. If the TargetAggregateFunction // is set i.e. not 'None', but the freq parameter is not set, @@ -3061,6 +4312,54 @@ type ForecastingTrainingSettings struct { StackEnsembleSettings *StackEnsembleSettings } +// 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, + } +} + +type GetBlobReferenceForConsumptionDto struct { + // Blob uri, example: https://blob.windows.core.net/Container/Path + BlobURI *string + + // Credential info to access storage account + Credential DataReferenceCredentialClassification + + // The ARM id of the storage account + StorageAccountArmID *string +} + +// GetBlobReferenceSASRequestDto - BlobReferenceSASRequest for getBlobReferenceSAS API +type GetBlobReferenceSASRequestDto struct { + // Id of the asset to be accessed + AssetID *string + + // 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 type GridSamplingAlgorithm struct { // REQUIRED; [Required] The algorithm used for generating hyperparameter values, along with configuration properties @@ -3175,6 +4474,24 @@ type IdentityForCmk struct { 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 +} + +// Image - Describes the Image Specifications +type Image struct { + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]any + + // Image reference + Reference *string + + // Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images + Type *ImageType +} + // 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'. @@ -3353,13 +4670,27 @@ 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 +} + +// 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 @@ -3454,10 +4785,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 @@ -3565,10 +4899,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 @@ -4201,6 +5538,15 @@ type ImageVertical struct { ValidationDataSize *float64 } +// 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 @@ -4275,6 +5621,9 @@ type JobBaseProperties struct { // Is the asset archived? IsArchived *bool + // Notification setting for the job + NotificationSetting *NotificationSetting + // The asset property dictionary. Properties map[string]*string @@ -4380,6 +5729,10 @@ type JobService struct { // Endpoint type. JobServiceType *string + // 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. Port *int32 @@ -4460,6 +5813,9 @@ 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 @@ -4507,6 +5863,7 @@ func (k *KubernetesOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDepl return &OnlineDeploymentProperties{ AppInsightsEnabled: k.AppInsightsEnabled, CodeConfiguration: k.CodeConfiguration, + DataCollector: k.DataCollector, Description: k.Description, EgressPublicNetworkAccess: k.EgressPublicNetworkAccess, EndpointComputeType: k.EndpointComputeType, @@ -4557,6 +5914,22 @@ type KubernetesSchema struct { Properties *KubernetesProperties } +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 @@ -4686,7 +6059,7 @@ 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 // The asset description text. @@ -4765,6 +6138,22 @@ func (m *MLTableJobOutput) GetJobOutput() *JobOutput { } } +// ManagedComputeIdentity - Managed compute identity definition. +type ManagedComputeIdentity struct { + // REQUIRED; [Required] Specifies the type of identity to use within the monitoring jobs. + ComputeIdentityType *MonitorComputeIdentityType + + // The identity which will be leveraged by the monitoring jobs. + 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. @@ -4792,28 +6181,102 @@ type ManagedIdentityAuthTypeWorkspaceConnectionProperties struct { AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Credentials *WorkspaceConnectionManagedIdentity - Target *string + Category *ConnectionCategory + Credentials *WorkspaceConnectionManagedIdentity + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string // Value details of the workspace connection. Value *string // format for the workspace connection value ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup } // 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, + Group: m.Group, + IsSharedToAll: m.IsSharedToAll, + Metadata: m.Metadata, + SharedUserList: m.SharedUserList, + Target: m.Target, + Value: m.Value, + ValueFormat: m.ValueFormat, + } +} + +// 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 + NetworkID *string +} + // ManagedOnlineDeployment - Properties specific to a ManagedOnlineDeployment. type ManagedOnlineDeployment struct { // REQUIRED; [Required] The compute type of the endpoint. @@ -4825,6 +6288,9 @@ 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 @@ -4872,6 +6338,7 @@ func (m *ManagedOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDeploym return &OnlineDeploymentProperties{ AppInsightsEnabled: m.AppInsightsEnabled, CodeConfiguration: m.CodeConfiguration, + DataCollector: m.DataCollector, Description: m.Description, EgressPublicNetworkAccess: m.EgressPublicNetworkAccess, EndpointComputeType: m.EndpointComputeType, @@ -4889,24 +6356,99 @@ func (m *ManagedOnlineDeployment) GetOnlineDeploymentProperties() *OnlineDeploym } } -// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) -type ManagedServiceIdentity struct { - // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - Type *ManagedServiceIdentityType +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity 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 +} + +type MarketplacePlan struct { + // READ-ONLY; The identifying name of the Offer of the Marketplace Plan. + OfferID *string + + // READ-ONLY; The identifying name of the Plan of the Marketplace Plan. + PlanID *string + + // READ-ONLY; The identifying name of the Publisher of the Marketplace Plan. + PublisherID *string +} + +// MarketplaceSubscription - Azure Resource Manager resource envelope. +type MarketplaceSubscription struct { + // REQUIRED; [Required] Additional attributes of the entity. + Properties *MarketplaceSubscriptionProperties + + // 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 MarketplaceSubscriptionProperties struct { + // REQUIRED; [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + ModelID *string + + // READ-ONLY; Marketplace Plan associated with the Marketplace Subscription. + MarketplacePlan *MarketplacePlan + + // READ-ONLY; Current status of the Marketplace Subscription. + MarketplaceSubscriptionStatus *MarketplaceSubscriptionStatus + + // READ-ONLY; Provisioning State of the Marketplace Subscription. + ProvisioningState *MarketplaceSubscriptionProvisioningState +} + +// MarketplaceSubscriptionResourceArmPaginatedResult - A paginated list of MarketplaceSubscription entities. +type MarketplaceSubscriptionResourceArmPaginatedResult struct { + // The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + NextLink *string - // 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 + // An array of objects of type MarketplaceSubscription. + Value []*MarketplaceSubscription +} - // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned - // identity. - PrincipalID *string +// MaterializationComputeResource - DTO object representing compute resource +type MaterializationComputeResource struct { + // Specifies the instance type + InstanceType *string +} - // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - TenantID *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 @@ -4966,6 +6508,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. @@ -4977,6 +6522,11 @@ type ModelContainerResourceArmPaginatedResult struct { Value []*ModelContainer } +type ModelSettings struct { + // The unique model identifier that this ServerlessEndpoint should provision. + ModelID *string +} + // ModelVersion - Azure Resource Manager resource envelope. type ModelVersion struct { // REQUIRED; [Required] Additional attributes of the entity. @@ -5021,8 +6571,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. @@ -5034,6 +6590,136 @@ type ModelVersionResourceArmPaginatedResult struct { Value []*ModelVersion } +// MonitorComputeConfigurationBase - Monitor compute configuration base definition. +type MonitorComputeConfigurationBase struct { + // REQUIRED; [Required] Specifies the type of signal to monitor. + ComputeType *MonitorComputeType +} + +// GetMonitorComputeConfigurationBase implements the MonitorComputeConfigurationBaseClassification interface for type MonitorComputeConfigurationBase. +func (m *MonitorComputeConfigurationBase) GetMonitorComputeConfigurationBase() *MonitorComputeConfigurationBase { + return m +} + +// MonitorComputeIdentityBase - Monitor compute identity base definition. +type MonitorComputeIdentityBase struct { + // REQUIRED; [Required] Specifies the type of identity to use within the monitoring jobs. + ComputeIdentityType *MonitorComputeIdentityType +} + +// 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 entities targeted by the monitor. + MonitoringTarget *MonitoringTarget +} + +type MonitorEmailNotificationSettings struct { + // 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 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 monitored model. + TaskType *ModelTaskType + + // Reference to the deployment asset targeted by this monitor. + DeploymentID *string + + // Reference to the model asset 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 +} + // Mpi - MPI distribution configuration. type Mpi struct { // REQUIRED; [Required] Specifies the type of distribution framework. @@ -5109,29 +6795,56 @@ 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 + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string // Value details of the workspace connection. Value *string // format for the workspace connection value ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup } // 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, + Group: n.Group, + IsSharedToAll: n.IsSharedToAll, + Metadata: n.Metadata, + SharedUserList: n.SharedUserList, + Target: n.Target, + Value: n.Value, + ValueFormat: n.ValueFormat, } } @@ -5189,6 +6902,123 @@ type NotebookResourceInfo struct { ResourceID *string } +// 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, + } +} + +type OAuth2AuthTypeWorkspaceConnectionProperties struct { + // REQUIRED; Authentication type of the connection target + AuthType *ConnectionAuthType + + // Category of the connection + Category *ConnectionCategory + + // ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 provider's implementation. + Credentials *WorkspaceConnectionOAuth2 + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type OAuth2AuthTypeWorkspaceConnectionProperties. +func (o *OAuth2AuthTypeWorkspaceConnectionProperties) GetWorkspaceConnectionPropertiesV2() *WorkspaceConnectionPropertiesV2 { + return &WorkspaceConnectionPropertiesV2{ + AuthType: o.AuthType, + Category: o.Category, + CreatedByWorkspaceArmID: o.CreatedByWorkspaceArmID, + ExpiryTime: o.ExpiryTime, + Group: o.Group, + IsSharedToAll: o.IsSharedToAll, + Metadata: o.Metadata, + SharedUserList: o.SharedUserList, + Target: o.Target, + Value: o.Value, + ValueFormat: o.ValueFormat, + } +} + // Objective - Optimization objective. type Objective struct { // REQUIRED; [Required] Defines supported metric goals for hyperparameter tuning @@ -5198,6 +7028,63 @@ type Objective struct { 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 + + // 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 +} + +// GetDatastoreProperties implements the DatastorePropertiesClassification interface for type OneLakeDatastore. +func (o *OneLakeDatastore) GetDatastoreProperties() *DatastoreProperties { + return &DatastoreProperties{ + Credentials: o.Credentials, + DatastoreType: o.DatastoreType, + Description: o.Description, + IsDefault: o.IsDefault, + Properties: o.Properties, + Tags: o.Tags, + } +} + type OnlineDeployment struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -5240,6 +7127,9 @@ 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 @@ -5344,6 +7234,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 @@ -5377,7 +7271,9 @@ type OnlineRequestSettings struct { // The number of maximum concurrent requests per node allowed per deployment. Defaults to 1. MaxConcurrentRequestsPerInstance *int32 - // The maximum amount of time a request will stay in the queue in ISO 8601 format. Defaults to 500ms. + // (Deprecated for Managed Online Endpoints) The maximum amount of time a request will stay in the queue in ISO 8601 format. + // Defaults to 500ms. (Now increase request_timeout_ms to account for any + // networking/queue delays) MaxQueueWait *string // The scoring timeout in ISO 8601 format. Defaults to 5000ms. @@ -5393,6 +7289,98 @@ type OnlineScaleSettings struct { // GetOnlineScaleSettings implements the OnlineScaleSettingsClassification interface for type OnlineScaleSettings. func (o *OnlineScaleSettings) GetOnlineScaleSettings() *OnlineScaleSettings { return o } +// 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 +} + +// 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 } + +// OutboundRuleBasicResource - Outbound Rule Basic Resource for the managed network of a machine learning workspace. +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. type OutputPathAssetReference struct { // REQUIRED; [Required] Specifies the type of asset reference. @@ -5417,25 +7405,43 @@ type PATAuthTypeWorkspaceConnectionProperties struct { AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Credentials *WorkspaceConnectionPersonalAccessToken - Target *string + Category *ConnectionCategory + Credentials *WorkspaceConnectionPersonalAccessToken + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string // Value details of the workspace connection. Value *string // format for the workspace connection value ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup } // 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, + Group: p.Group, + IsSharedToAll: p.IsSharedToAll, + Metadata: p.Metadata, + SharedUserList: p.SharedUserList, + Target: p.Target, + Value: p.Value, + ValueFormat: p.ValueFormat, } } @@ -5500,6 +7506,30 @@ 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 +} + +// 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 @@ -5524,8 +7554,37 @@ type Password struct { // READ-ONLY Name *string - // READ-ONLY - Value *string + // READ-ONLY + 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. @@ -5567,6 +7626,9 @@ type PipelineJob struct { // 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 @@ -5592,18 +7654,65 @@ type PipelineJob struct { // 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, - Properties: p.Properties, - Services: p.Services, - Status: p.Status, - Tags: p.Tags, + 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, + Services: p.Services, + Status: p.Status, + Tags: p.Tags, + } +} + +type PredictionDriftMetricThresholdBase 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 +} + +// GetPredictionDriftMetricThresholdBase implements the PredictionDriftMetricThresholdBaseClassification interface for type +// PredictionDriftMetricThresholdBase. +func (p *PredictionDriftMetricThresholdBase) GetPredictionDriftMetricThresholdBase() *PredictionDriftMetricThresholdBase { + return p +} + +type PredictionDriftMonitoringSignal struct { + // REQUIRED; [Required] A list of metrics to calculate and their associated thresholds. + MetricThresholds []PredictionDriftMetricThresholdBaseClassification + + // 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 PredictionDriftMonitoringSignal. +func (p *PredictionDriftMonitoringSignal) GetMonitoringSignalBase() *MonitoringSignalBase { + return &MonitoringSignalBase{ + NotificationTypes: p.NotificationTypes, + Properties: p.Properties, + SignalType: p.SignalType, } } @@ -5611,9 +7720,6 @@ 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. @@ -5664,6 +7770,50 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } +// 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 +} + +// 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 +} + +// GetOutboundRule implements the OutboundRuleClassification interface for type PrivateEndpointOutboundRule. +func (p *PrivateEndpointOutboundRule) GetOutboundRule() *OutboundRule { + return &OutboundRule{ + Category: p.Category, + Status: p.Status, + Type: p.Type, + } +} + +// 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. @@ -5743,6 +7893,22 @@ type ProbeSettings struct { Timeout *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. @@ -5759,6 +7925,11 @@ func (p *PyTorch) GetDistributionConfiguration() *DistributionConfiguration { } } +type QueueSettings struct { + // Controls the compute job tier + JobTier *JobTier +} + // QuotaBaseProperties - The properties for Quota update or retrieval. type QuotaBaseProperties struct { // Specifies the resource ID. @@ -5802,6 +7973,25 @@ func (r *RandomSamplingAlgorithm) GetSamplingAlgorithm() *SamplingAlgorithm { } } +// 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 @@ -5860,6 +8050,38 @@ 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 @@ -5870,6 +8092,111 @@ type RegistryListCredentialsResult struct { 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. @@ -5963,6 +8290,13 @@ type RegressionTrainingSettings struct { StackEnsembleSettings *StackEnsembleSettings } +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 +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -6036,6 +8370,44 @@ type ResourceQuota struct { 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 + + // REQUIRED; [Required] The size of the rolling data window. + WindowSize *string + + // Mapping of column names to special uses. + Columns map[string]*string + + // The context metadata of the data source. + DataContext *string + + // Reference to the component asset 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 { // REQUIRED; [Required] The path for the route. Path *string @@ -6049,25 +8421,74 @@ type SASAuthTypeWorkspaceConnectionProperties struct { AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Credentials *WorkspaceConnectionSharedAccessSignature - Target *string + Category *ConnectionCategory + Credentials *WorkspaceConnectionSharedAccessSignature + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string // Value details of the workspace connection. Value *string // format for the workspace connection value ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup } // 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, + Group: s.Group, + IsSharedToAll: s.IsSharedToAll, + Metadata: s.Metadata, + SharedUserList: s.SharedUserList, + Target: s.Target, + Value: s.Value, + ValueFormat: s.ValueFormat, + } +} + +// 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, } } @@ -6291,44 +8712,179 @@ type ScheduleResourceArmPaginatedResult struct { Value []*Schedule } -// ScriptReference - Script reference -type ScriptReference struct { - // Optional command line arguments passed to the script to run. - ScriptArguments *string +// ScriptReference - Script reference +type ScriptReference struct { + // Optional command line arguments passed to the script to run. + ScriptArguments *string + + // The location of scripts in the mounted volume. + ScriptData *string + + // The storage source of the script: workspace. + ScriptSource *string + + // Optional time period passed to timeout command. + Timeout *string +} + +// ScriptsToExecute - Customized setup scripts +type ScriptsToExecute struct { + // Script that's run only once during provision of the compute. + CreationScript *ScriptReference + + // Script that's run every time the machine starts. + StartupScript *ScriptReference +} + +// Seasonality - Forecasting seasonality. +type Seasonality struct { + // REQUIRED; [Required] Seasonality mode. + Mode *SeasonalityMode +} + +// GetSeasonality implements the SeasonalityClassification interface for type Seasonality. +func (s *Seasonality) GetSeasonality() *Seasonality { return s } + +// SecretExpiry - Secret expiration configuration. +type SecretExpiry struct { + // Indicates if the secret is expirable. + ExpirableSecret *bool + + // Number of hours after which the secret will expire. + ExpireAfterHours *int32 +} + +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 ServerlessEndpointProperties struct { + // REQUIRED; [Required] Specifies the authentication mode for the Serverless endpoint. + AuthMode *ServerlessInferenceEndpointAuthMode - // The location of scripts in the mounted volume. - ScriptData *string + // Specifies the content safety options. If omitted, the default content safety settings will be configured + ContentSafety *ContentSafety - // The storage source of the script: workspace. - ScriptSource *string + // The model settings (model id) for the model being serviced on the ServerlessEndpoint. + ModelSettings *ModelSettings - // Optional time period passed to timeout command. - Timeout *string -} + // READ-ONLY; The current state of the ServerlessEndpoint. + EndpointState *ServerlessEndpointState -// ScriptsToExecute - Customized setup scripts -type ScriptsToExecute struct { - // Script that's run only once during provision of the compute. - CreationScript *ScriptReference + // READ-ONLY; The inference uri to target when making requests against the serverless endpoint + InferenceEndpoint *ServerlessInferenceEndpoint - // Script that's run every time the machine starts. - StartupScript *ScriptReference + // READ-ONLY; The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + MarketplaceSubscriptionID *string + + // READ-ONLY; Provisioning state for the endpoint. + ProvisioningState *EndpointProvisioningState } -// Seasonality - Forecasting seasonality. -type Seasonality struct { - // REQUIRED; [Required] Seasonality mode. - Mode *SeasonalityMode +// 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 } -// GetSeasonality implements the SeasonalityClassification interface for type Seasonality. -func (s *Seasonality) GetSeasonality() *Seasonality { return s } +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 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 + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string + + // Value details of the workspace connection. + Value *string + + // format for the workspace connection value + ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup +} + +// 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, + Group: s.Group, + IsSharedToAll: s.IsSharedToAll, + Metadata: s.Metadata, + SharedUserList: s.SharedUserList, + Target: s.Target, + Value: s.Value, + ValueFormat: s.ValueFormat, + } +} + // ServicePrincipalDatastoreCredentials - Service Principal datastore credentials configuration. type ServicePrincipalDatastoreCredentials struct { // REQUIRED; [Required] Service principal client ID. @@ -6373,6 +8929,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 @@ -6402,6 +8995,157 @@ type SharedPrivateLinkResourceProperty struct { Status *PrivateEndpointServiceConnectionStatus } +// SparkJob - Spark job definition. +type SparkJob struct { + // REQUIRED; [Required] arm-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 + + // 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, + 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. type StackEnsembleSettings struct { // Optional parameters to pass to the initializer of the meta-learner. @@ -6415,6 +9159,53 @@ 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 + + // Reference to the component asset 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, + } +} + +// 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. @@ -6464,12 +9255,18 @@ 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 + // List of JobEndpoints. For local jobs, a job endpoint will have an endpoint value of FileStreamObject. Services map[string]*JobService @@ -6483,18 +9280,19 @@ type SweepJob struct { // GetJobBaseProperties implements the JobBasePropertiesClassification interface for type SweepJob. func (s *SweepJob) 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, - Properties: s.Properties, - Services: s.Services, - Status: s.Status, - 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, + Services: s.Services, + Status: s.Status, + Tags: s.Tags, } } @@ -6608,6 +9406,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). @@ -6896,6 +9723,27 @@ func (t *TextNer) GetAutoMLVertical() *AutoMLVertical { } } +// TmpfsOptions - Describes the tmpfs options for the container +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 { @@ -7059,7 +9907,7 @@ 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 // The asset description text. @@ -7140,7 +9988,7 @@ 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 // The asset description text. @@ -7298,6 +10146,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. @@ -7316,25 +10174,43 @@ type UsernamePasswordAuthTypeWorkspaceConnectionProperties struct { AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Credentials *WorkspaceConnectionUsernamePassword - Target *string + Category *ConnectionCategory + Credentials *WorkspaceConnectionUsernamePassword + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string // Value details of the workspace connection. Value *string // format for the workspace connection value ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup } // 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, + Group: u.Group, + IsSharedToAll: u.IsSharedToAll, + Metadata: u.Metadata, + SharedUserList: u.SharedUserList, + Target: u.Target, + Value: u.Value, + ValueFormat: u.ValueFormat, } } @@ -7497,10 +10373,56 @@ type VirtualMachineSizeListResult struct { Value []*VirtualMachineSize } +// VolumeDefinition - Describes the volume configuration for the container +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 +} + +// VolumeOptions - Describes the volume options for the container +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 + Kind *string // Specifies the location of the resource. Location *string @@ -7527,11 +10449,50 @@ 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 WorkspaceConnectionAccountKey struct { + Key *string +} + type WorkspaceConnectionManagedIdentity struct { ClientID *string ResourceID *string } +// WorkspaceConnectionOAuth2 - ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 +// provider's implementation. +type WorkspaceConnectionOAuth2 struct { + // Required by Concur connection category + AuthURL *string + + // Client id in the format of UUID + ClientID *string + ClientSecret *string + + // Required by GoogleAdWords connection category + DeveloperToken *string + Password *string + + // Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho where user needs to get RefreshToken + // offline + RefreshToken *string + + // Required by QuickBooks and Xero connection categories + TenantID *string + + // Concur, ServiceNow auth server AccessToken grant type is 'Password' which requires UsernamePassword + Username *string +} + type WorkspaceConnectionPersonalAccessToken struct { Pat *string } @@ -7541,14 +10502,26 @@ type WorkspaceConnectionPropertiesV2 struct { AuthType *ConnectionAuthType // Category of the connection - Category *ConnectionCategory - Target *string + Category *ConnectionCategory + ExpiryTime *time.Time + IsSharedToAll *bool + + // Store user metadata for this connection + Metadata map[string]*string + SharedUserList []*string + Target *string // Value details of the workspace connection. Value *string // format for the workspace connection value ValueFormat *ValueFormat + + // READ-ONLY + CreatedByWorkspaceArmID *string + + // READ-ONLY; Group based on connection category + Group *ConnectionGroup } // GetWorkspaceConnectionPropertiesV2 implements the WorkspaceConnectionPropertiesV2Classification interface for type WorkspaceConnectionPropertiesV2. @@ -7580,13 +10553,28 @@ type WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult struct { NextLink *string } +type WorkspaceConnectionServicePrincipal struct { + ClientID *string + ClientSecret *string + TenantID *string +} + type WorkspaceConnectionSharedAccessSignature struct { Sas *string } type WorkspaceConnectionUsernamePassword struct { Password *string - Username *string + + // Optional, required by connections like SalesForce for extra security in addition to UsernamePassword + SecurityToken *string + Username *string +} + +// WorkspaceHubConfig - WorkspaceHub's configuration object. +type WorkspaceHubConfig struct { + AdditionalWorkspaceStorageAccounts []*string + DefaultWorkspaceResourceGroup *string } // WorkspaceListResult - The result of a request to list machine learning workspaces. @@ -7605,7 +10593,8 @@ type WorkspaceProperties struct { AllowPublicAccessWhenBehindVnet *bool // ARM id of the application insights associated with this workspace. - ApplicationInsights *string + ApplicationInsights *string + AssociatedWorkspaces []*string // ARM id of the container registry associated with this workspace. ContainerRegistry *string @@ -7614,16 +10603,21 @@ 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 // 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 @@ -7631,12 +10625,18 @@ type WorkspaceProperties struct { // ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created KeyVault *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 + // Settings for serverless compute created in the workspace + ServerlessComputeSettings *ServerlessComputeSettings + // The service managed resource settings. ServiceManagedResourcesSettings *ServiceManagedResourcesSettings @@ -7649,6 +10649,9 @@ type WorkspaceProperties struct { // 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 @@ -7688,7 +10691,12 @@ type WorkspacePropertiesUpdateParameters struct { ContainerRegistry *string // The description of this workspace. - Description *string + Description *string + EnableDataIsolation *bool + Encryption *EncryptionUpdateProperties + + // Settings for feature store type workspace. + FeatureStoreSettings *FeatureStoreSettings // The friendly name for this workspace. FriendlyName *string @@ -7696,14 +10704,23 @@ type WorkspacePropertiesUpdateParameters struct { // 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 + // Settings for serverless compute created in the workspace + ServerlessComputeSettings *ServerlessComputeSettings + // The service managed resource settings. ServiceManagedResourcesSettings *ServiceManagedResourcesSettings + + // Enabling v1legacymode may prevent you from using features provided by the v2 API. + V1LegacyMode *bool } // WorkspaceUpdateParameters - The parameters for updating a machine learning workspace. diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go b/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go index b9a04c1154dc..afe424ec9332 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/models_serde.go @@ -15,6 +15,73 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type AADAuthTypeWorkspaceConnectionProperties. +func (a AADAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = ConnectionAuthTypeAAD + populate(objectMap, "category", a.Category) + populate(objectMap, "createdByWorkspaceArmId", a.CreatedByWorkspaceArmID) + populateDateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime) + populate(objectMap, "group", a.Group) + populate(objectMap, "isSharedToAll", a.IsSharedToAll) + populate(objectMap, "metadata", a.Metadata) + populate(objectMap, "sharedUserList", a.SharedUserList) + populate(objectMap, "target", a.Target) + populate(objectMap, "value", a.Value) + populate(objectMap, "valueFormat", a.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AADAuthTypeWorkspaceConnectionProperties. +func (a *AADAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(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 "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime) + delete(rawMsg, key) + case "group": + err = unpopulate(val, "Group", &a.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &a.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &a.ValueFormat) + 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 AKS. func (a AKS) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -168,6 +235,219 @@ 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, "group", a.Group) + populate(objectMap, "isSharedToAll", a.IsSharedToAll) + populate(objectMap, "metadata", a.Metadata) + populate(objectMap, "sharedUserList", a.SharedUserList) + populate(objectMap, "target", a.Target) + populate(objectMap, "value", a.Value) + populate(objectMap, "valueFormat", a.ValueFormat) + 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 "group": + err = unpopulate(val, "Group", &a.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &a.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &a.ValueFormat) + 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, "group", a.Group) + populate(objectMap, "isSharedToAll", a.IsSharedToAll) + populate(objectMap, "metadata", a.Metadata) + populate(objectMap, "sharedUserList", a.SharedUserList) + populate(objectMap, "target", a.Target) + populate(objectMap, "value", a.Value) + populate(objectMap, "valueFormat", a.ValueFormat) + 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 "group": + err = unpopulate(val, "Group", &a.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &a.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &a.ValueFormat) + 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 AccountKeyAuthTypeWorkspaceConnectionProperties. +func (a AccountKeyAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authType"] = ConnectionAuthTypeAccountKey + populate(objectMap, "category", a.Category) + populate(objectMap, "createdByWorkspaceArmId", a.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", a.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime) + populate(objectMap, "group", a.Group) + populate(objectMap, "isSharedToAll", a.IsSharedToAll) + populate(objectMap, "metadata", a.Metadata) + populate(objectMap, "sharedUserList", a.SharedUserList) + populate(objectMap, "target", a.Target) + populate(objectMap, "value", a.Value) + populate(objectMap, "valueFormat", a.ValueFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKeyAuthTypeWorkspaceConnectionProperties. +func (a *AccountKeyAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(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 "group": + err = unpopulate(val, "Group", &a.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &a.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &a.ValueFormat) + 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) @@ -230,6 +510,37 @@ 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 AksComputeSecrets. func (a AksComputeSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -343,6 +654,60 @@ 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) @@ -606,17 +971,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) @@ -624,14 +987,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 { @@ -641,18 +998,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) @@ -660,17 +1014,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 { @@ -680,15 +1025,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) @@ -696,8 +1043,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 { @@ -707,15 +1060,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) @@ -723,8 +1076,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 { @@ -734,17 +1087,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) @@ -752,14 +1103,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 { @@ -1019,8 +1364,10 @@ 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, "services", a.Services) populate(objectMap, "status", a.Status) @@ -1068,12 +1415,18 @@ 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) @@ -1322,7 +1675,9 @@ func (a AzureBlobDatastore) MarshalJSON() ([]byte, error) { 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) } @@ -1363,9 +1718,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) @@ -1385,8 +1746,10 @@ func (a AzureDataLakeGen1Datastore) MarshalJSON() ([]byte, error) { populate(objectMap, "description", a.Description) 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) } @@ -1415,12 +1778,18 @@ func (a *AzureDataLakeGen1Datastore) UnmarshalJSON(data []byte) error { 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) @@ -1444,7 +1813,9 @@ func (a AzureDataLakeGen2Datastore) MarshalJSON() ([]byte, error) { 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) } @@ -1485,9 +1856,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) @@ -1499,6 +1876,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) @@ -1511,7 +1950,9 @@ func (a AzureFileDatastore) MarshalJSON() ([]byte, error) { 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) } @@ -1552,9 +1993,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) @@ -1672,11 +2119,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) @@ -1709,6 +2184,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) @@ -1966,6 +2444,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) @@ -2024,6 +2545,76 @@ func (b *BayesianSamplingAlgorithm) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BindOptions. +func (b BindOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "createHostPath": + err = unpopulate(val, "CreateHostPath", &b.CreateHostPath) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobReferenceForConsumptionDto. +func (b BlobReferenceForConsumptionDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobUri": + err = unpopulate(val, "BlobURI", &b.BlobURI) + delete(rawMsg, key) + case "credential": + b.Credential, err = unmarshalPendingUploadCredentialDtoClassification(val) + delete(rawMsg, key) + case "storageAccountArmId": + err = unpopulate(val, "StorageAccountArmID", &b.StorageAccountArmID) + 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 BuildContext. func (b BuildContext) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2055,6 +2646,111 @@ func (b *BuildContext) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CategoricalDataDriftMetricThreshold. +func (c CategoricalDataDriftMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CategoricalDataQualityMetricThreshold. +func (c CategoricalDataQualityMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CategoricalPredictionDriftMetricThreshold. +func (c CategoricalPredictionDriftMetricThreshold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &c.DataType) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CertificateDatastoreCredentials. func (c CertificateDatastoreCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2419,6 +3115,7 @@ func (c CodeContainerProperties) MarshalJSON() ([]byte, error) { 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) } @@ -2447,8 +3144,11 @@ func (c *CodeContainerProperties) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + 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 { @@ -2540,6 +3240,7 @@ func (c CodeVersionProperties) MarshalJSON() ([]byte, error) { 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) } @@ -2568,6 +3269,9 @@ func (c *CodeVersionProperties) 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) @@ -2610,6 +3314,45 @@ func (c *CodeVersionResourceArmPaginatedResult) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type Collection. +func (c Collection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) + delete(rawMsg, key) + case "dataCollectionMode": + err = unpopulate(val, "DataCollectionMode", &c.DataCollectionMode) + delete(rawMsg, key) + case "dataId": + err = unpopulate(val, "DataID", &c.DataID) + delete(rawMsg, key) + case "samplingRate": + err = unpopulate(val, "SamplingRate", &c.SamplingRate) + 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 ColumnTransformer. func (c ColumnTransformer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2659,9 +3402,11 @@ func (c CommandJob) MarshalJSON() ([]byte, error) { 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, "services", c.Services) populate(objectMap, "status", c.Status) @@ -2723,6 +3468,9 @@ func (c *CommandJob) UnmarshalJSON(data []byte) error { 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) @@ -2732,6 +3480,9 @@ func (c *CommandJob) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) + case "queueSettings": + err = unpopulate(val, "QueueSettings", &c.QueueSettings) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &c.Resources) delete(rawMsg, key) @@ -2834,6 +3585,7 @@ func (c ComponentContainerProperties) MarshalJSON() ([]byte, error) { 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) } @@ -2862,6 +3614,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) @@ -2955,6 +3710,7 @@ func (c ComponentVersionProperties) MarshalJSON() ([]byte, error) { 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) } @@ -2983,6 +3739,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) @@ -3476,11 +4235,13 @@ func (c ComputeInstanceProperties) MarshalJSON() ([]byte, error) { 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, "errors", c.Errors) populate(objectMap, "lastOperation", c.LastOperation) + populate(objectMap, "osImageMetadata", c.OSImageMetadata) populate(objectMap, "personalComputeInstanceSettings", c.PersonalComputeInstanceSettings) populate(objectMap, "sshSettings", c.SSHSettings) populate(objectMap, "schedules", c.Schedules) @@ -3519,6 +4280,9 @@ func (c *ComputeInstanceProperties) UnmarshalJSON(data []byte) error { 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) @@ -3534,6 +4298,9 @@ func (c *ComputeInstanceProperties) UnmarshalJSON(data []byte) error { 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) @@ -3659,6 +4426,45 @@ func (c *ComputeInstanceVersion) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ComputeRecurrenceSchedule. +func (c ComputeRecurrenceSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "hours": + err = unpopulate(val, "Hours", &c.Hours) + delete(rawMsg, key) + case "minutes": + err = unpopulate(val, "Minutes", &c.Minutes) + delete(rawMsg, key) + case "monthDays": + err = unpopulate(val, "MonthDays", &c.MonthDays) + delete(rawMsg, key) + case "weekDays": + err = unpopulate(val, "WeekDays", &c.WeekDays) + 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 ComputeResource. func (c ComputeResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3745,6 +4551,33 @@ func (c *ComputeResourceSchema) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ComputeRuntimeDto. +func (c ComputeRuntimeDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sparkRuntimeVersion", c.SparkRuntimeVersion) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "sparkRuntimeVersion": + err = unpopulate(val, "SparkRuntimeVersion", &c.SparkRuntimeVersion) + 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 ComputeSchedules. func (c ComputeSchedules) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3920,6 +4753,33 @@ func (c *ContainerResourceSettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContentSafety. +func (c ContentSafety) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contentSafetyStatus", c.ContentSafetyStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentSafety. +func (c *ContentSafety) UnmarshalJSON(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 "contentSafetyStatus": + err = unpopulate(val, "ContentSafetyStatus", &c.ContentSafetyStatus) + 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 CosmosDbSettings. func (c CosmosDbSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3947,6 +4807,72 @@ func (c *CosmosDbSettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CreateMonitorAction. +func (c CreateMonitorAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["actionType"] = ScheduleActionTypeCreateMonitor + populate(objectMap, "monitorDefinition", c.MonitorDefinition) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Cron. +func (c Cron) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CronTrigger. func (c CronTrigger) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4021,18 +4947,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 CustomKeys. +func (c CustomKeys) 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, "keys", c.Keys) 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 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", c, err) @@ -4040,17 +4963,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 "keys": + err = unpopulate(val, "Keys", &c.Keys) delete(rawMsg, key) } if err != nil { @@ -4060,18 +4974,26 @@ 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 CustomKeysWorkspaceConnectionProperties. +func (c CustomKeysWorkspaceConnectionProperties) 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) + 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, "group", c.Group) + populate(objectMap, "isSharedToAll", c.IsSharedToAll) + populate(objectMap, "metadata", c.Metadata) + populate(objectMap, "sharedUserList", c.SharedUserList) + populate(objectMap, "target", c.Target) + populate(objectMap, "value", c.Value) + populate(objectMap, "valueFormat", c.ValueFormat) 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 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", c, err) @@ -4079,17 +5001,41 @@ 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 "authType": + err = unpopulate(val, "AuthType", &c.AuthType) delete(rawMsg, key) - case "jobOutputType": - err = unpopulate(val, "JobOutputType", &c.JobOutputType) + case "category": + err = unpopulate(val, "Category", &c.Category) delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &c.Mode) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &c.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &c.URI) + case "credentials": + err = unpopulate(val, "Credentials", &c.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &c.ExpiryTime) + delete(rawMsg, key) + case "group": + err = unpopulate(val, "Group", &c.Group) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &c.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &c.Metadata) + delete(rawMsg, key) + case "sharedUserList": + err = unpopulate(val, "SharedUserList", &c.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &c.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &c.ValueFormat) delete(rawMsg, key) } if err != nil { @@ -4099,16 +5045,16 @@ 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 CustomMetricThreshold. +func (c CustomMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = NCrossValidationsModeCustom - populate(objectMap, "value", c.Value) + populate(objectMap, "metric", c.Metric) + populate(objectMap, "threshold", c.Threshold) 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 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", c, err) @@ -4116,11 +5062,11 @@ 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 "metric": + err = unpopulate(val, "Metric", &c.Metric) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "threshold": + err = unpopulate(val, "Threshold", &c.Threshold) delete(rawMsg, key) } if err != nil { @@ -4130,16 +5076,18 @@ func (c *CustomNCrossValidations) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomSeasonality. -func (c CustomSeasonality) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomModelJobInput. +func (c CustomModelJobInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = SeasonalityModeCustom - populate(objectMap, "value", c.Value) + 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 CustomSeasonality. -func (c *CustomSeasonality) 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", c, err) @@ -4147,11 +5095,17 @@ func (c *CustomSeasonality) 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 "value": - err = unpopulate(val, "Value", &c.Value) + case "uri": + err = unpopulate(val, "URI", &c.URI) delete(rawMsg, key) } if err != nil { @@ -4161,9 +5115,223 @@ func (c *CustomSeasonality) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomTargetLags. -func (c CustomTargetLags) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) +// MarshalJSON implements the json.Marshaller interface for type CustomModelJobOutput. +func (c CustomModelJobOutput) 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) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + for key, val := range rawMsg { + var err error + switch 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", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomMonitoringSignal. +func (c CustomMonitoringSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 + return json.Marshal(objectMap) +} + +// 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", 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", &c.Properties) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &c.SignalType) + 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 CustomNCrossValidations. +func (c CustomNCrossValidations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["mode"] = NCrossValidationsModeCustom + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + 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) + 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) { + objectMap := make(map[string]any) + objectMap["mode"] = SeasonalityModeCustom + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// 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", c, err) + } + 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) + 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 CustomService. +func (c CustomService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "docker", c.Docker) + populate(objectMap, "endpoints", c.Endpoints) + populate(objectMap, "environmentVariables", c.EnvironmentVariables) + populate(objectMap, "image", c.Image) + 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 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "docker": + err = unpopulate(val, "Docker", &c.Docker) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &c.Endpoints) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &c.Image) + delete(rawMsg, key) + 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", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomTargetLags. +func (c CustomTargetLags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) objectMap["mode"] = TargetLagsModeCustom populate(objectMap, "values", c.Values) return json.Marshal(objectMap) @@ -4223,6 +5391,41 @@ func (c *CustomTargetRollingWindowSize) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DataCollector. +func (d DataCollector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + 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 { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DataContainer. func (d DataContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4348,6 +5551,96 @@ func (d *DataContainerResourceArmPaginatedResult) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type DataDriftMetricThresholdBase. +func (d DataDriftMetricThresholdBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["dataType"] = d.DataType + populate(objectMap, "threshold", d.Threshold) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &d.Threshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataDriftMonitoringSignal. +func (d DataDriftMonitoringSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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) + } + for key, val := range rawMsg { + var err error + switch 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 { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DataFactory. func (d DataFactory) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4567,11 +5860,128 @@ func (d *DataPathAssetReference) UnmarshalJSON(data []byte) error { 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 DataQualityMetricThresholdBase. +func (d DataQualityMetricThresholdBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) + objectMap["dataType"] = d.DataType + populate(objectMap, "threshold", d.Threshold) + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) + delete(rawMsg, key) + case "threshold": + err = unpopulate(val, "Threshold", &d.Threshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataQualityMonitoringSignal. +func (d DataQualityMonitoringSignal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch 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 = 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataReferenceCredential. +func (d DataReferenceCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["credentialType"] = d.CredentialType + return json.Marshal(objectMap) +} + +// 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentialType": + err = unpopulate(val, "CredentialType", &d.CredentialType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataVersionBase. +func (d DataVersionBase) 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) @@ -5170,6 +6580,41 @@ func (d *DeploymentResourceConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DestinationAsset. +func (d DestinationAsset) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationName": + err = unpopulate(val, "DestinationName", &d.DestinationName) + delete(rawMsg, key) + case "destinationVersion": + err = unpopulate(val, "DestinationVersion", &d.DestinationVersion) + delete(rawMsg, key) + case "registryName": + err = unpopulate(val, "RegistryName", &d.RegistryName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DiagnoseRequestProperties. func (d DiagnoseRequestProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5404,6 +6849,83 @@ func (d *DistributionConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Docker. +func (d Docker) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + 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", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DockerCredential. +func (d DockerCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentialType": + err = unpopulate(val, "CredentialType", &d.CredentialType) + delete(rawMsg, key) + 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", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type EarlyTerminationPolicy. func (e EarlyTerminationPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5474,6 +6996,33 @@ func (e *EncryptionKeyVaultProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EncryptionKeyVaultUpdateProperties. +func (e EncryptionKeyVaultUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyIdentifier", e.KeyIdentifier) + return json.Marshal(objectMap) +} + +// 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &e.KeyIdentifier) + 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 EncryptionProperty. func (e EncryptionProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5509,6 +7058,76 @@ func (e *EncryptionProperty) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EncryptionUpdateProperties. +func (e EncryptionUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + return json.Marshal(objectMap) +} + +// 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + 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 Endpoint. +func (e Endpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostIp": + err = unpopulate(val, "HostIP", &e.HostIP) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &e.Protocol) + delete(rawMsg, key) + case "published": + err = unpopulate(val, "Published", &e.Published) + 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 EndpointAuthKeys. func (e EndpointAuthKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5751,6 +7370,7 @@ func (e EnvironmentContainerProperties) MarshalJSON() ([]byte, error) { 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) } @@ -5779,6 +7399,9 @@ func (e *EnvironmentContainerProperties) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) @@ -5821,19 +7444,21 @@ func (e *EnvironmentContainerResourceArmPaginatedResult) UnmarshalJSON(data []by 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 EnvironmentVariable. +func (e EnvironmentVariable) 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, "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 EnvironmentVersion. -func (e *EnvironmentVersion) UnmarshalJSON(data []byte) error { +// 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) @@ -5841,21 +7466,22 @@ func (e *EnvironmentVersion) UnmarshalJSON(data []byte) error { 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) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + 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) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -5864,8 +7490,51 @@ func (e *EnvironmentVersion) UnmarshalJSON(data []byte) error { 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 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 "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + 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 EnvironmentVersionProperties. +func (e EnvironmentVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoRebuild", e.AutoRebuild) populate(objectMap, "build", e.Build) @@ -5878,6 +7547,8 @@ func (e EnvironmentVersionProperties) MarshalJSON() ([]byte, error) { 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) } @@ -5924,6 +7595,12 @@ func (e *EnvironmentVersionProperties) UnmarshalJSON(data []byte) error { 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) @@ -6280,15 +7957,19 @@ func (f *FQDNEndpointsProperties) UnmarshalJSON(data []byte) error { 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 Feature. +func (f Feature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "datasetLanguage", f.DatasetLanguage) + 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 FeaturizationSettings. -func (f *FeaturizationSettings) UnmarshalJSON(data []byte) error { +// 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) @@ -6296,8 +7977,20 @@ func (f *FeaturizationSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "datasetLanguage": - err = unpopulate(val, "DatasetLanguage", &f.DatasetLanguage) + 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 { @@ -6307,15 +8000,22 @@ func (f *FeaturizationSettings) UnmarshalJSON(data []byte) error { 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 FeatureAttributionDriftMonitoringSignal. +func (f FeatureAttributionDriftMonitoringSignal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "data", f.Data) + 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 FlavorData. -func (f *FlavorData) UnmarshalJSON(data []byte) error { +// 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) @@ -6323,8 +8023,29 @@ func (f *FlavorData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "data": - err = unpopulate(val, "Data", &f.Data) + 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 { @@ -6334,15 +8055,16 @@ func (f *FlavorData) UnmarshalJSON(data []byte) error { 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 FeatureAttributionMetricThreshold. +func (f FeatureAttributionMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = f.Mode + populate(objectMap, "metric", f.Metric) + populate(objectMap, "threshold", f.Threshold) 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 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) @@ -6350,8 +8072,11 @@ func (f *ForecastHorizon) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &f.Mode) + 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 { @@ -6361,30 +8086,16 @@ func (f *ForecastHorizon) UnmarshalJSON(data []byte) error { 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 FeatureImportanceSettings. +func (f FeatureImportanceSettings) 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, "mode", f.Mode) + populate(objectMap, "targetColumn", f.TargetColumn) 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 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) @@ -6392,53 +8103,11 @@ func (f *Forecasting) UnmarshalJSON(data []byte) error { 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) - 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 "mode": + err = unpopulate(val, "Mode", &f.Mode) delete(rawMsg, key) - case "weightColumnName": - err = unpopulate(val, "WeightColumnName", &f.WeightColumnName) + case "targetColumn": + err = unpopulate(val, "TargetColumn", &f.TargetColumn) delete(rawMsg, key) } if err != nil { @@ -6448,27 +8117,19 @@ func (f *Forecasting) UnmarshalJSON(data []byte) error { 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 FeatureProperties. +func (f FeatureProperties) 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, "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 ForecastingSettings. -func (f *ForecastingSettings) UnmarshalJSON(data []byte) error { +// 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) @@ -6476,44 +8137,20 @@ func (f *ForecastingSettings) UnmarshalJSON(data []byte) error { 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) - 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) + case "dataType": + err = unpopulate(val, "DataType", &f.DataType) delete(rawMsg, key) - case "targetRollingWindowSize": - f.TargetRollingWindowSize, err = unmarshalTargetRollingWindowSizeClassification(val) + case "description": + err = unpopulate(val, "Description", &f.Description) delete(rawMsg, key) - case "timeColumnName": - err = unpopulate(val, "TimeColumnName", &f.TimeColumnName) + case "featureName": + err = unpopulate(val, "FeatureName", &f.FeatureName) delete(rawMsg, key) - case "timeSeriesIdColumnNames": - err = unpopulate(val, "TimeSeriesIDColumnNames", &f.TimeSeriesIDColumnNames) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "useStl": - err = unpopulate(val, "UseStl", &f.UseStl) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) delete(rawMsg, key) } if err != nil { @@ -6523,23 +8160,16 @@ func (f *ForecastingSettings) UnmarshalJSON(data []byte) error { 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 FeatureResourceArmPaginatedResult. +func (f FeatureResourceArmPaginatedResult) 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, "nextLink", f.NextLink) + populate(objectMap, "value", f.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 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) @@ -6547,32 +8177,11 @@ func (f *ForecastingTrainingSettings) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) - case "stackEnsembleSettings": - err = unpopulate(val, "StackEnsembleSettings", &f.StackEnsembleSettings) + case "value": + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) } if err != nil { @@ -6582,5696 +8191,10043 @@ func (f *ForecastingTrainingSettings) UnmarshalJSON(data []byte) error { 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 FeatureStoreSettings. +func (f FeatureStoreSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeGrid + 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 GridSamplingAlgorithm. -func (g *GridSamplingAlgorithm) UnmarshalJSON(data []byte) error { +// 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "samplingAlgorithmType": - err = unpopulate(val, "SamplingAlgorithmType", &g.SamplingAlgorithmType) + 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeatureSubset. +func (f FeatureSubset) 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) + populate(objectMap, "features", f.Features) + objectMap["filterType"] = MonitoringFeatureFilterTypeFeatureSubset 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 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "computeLocation": - err = unpopulate(val, "ComputeLocation", &h.ComputeLocation) + case "features": + err = unpopulate(val, "Features", &f.Features) 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) + case "filterType": + err = unpopulate(val, "FilterType", &f.FilterType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeatureWindow. +func (f FeatureWindow) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", h.Address) - populate(objectMap, "administratorAccount", h.AdministratorAccount) - populate(objectMap, "sshPort", h.SSHPort) + populateDateTimeRFC3339(objectMap, "featureWindowEnd", f.FeatureWindowEnd) + populateDateTimeRFC3339(objectMap, "featureWindowStart", f.FeatureWindowStart) 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 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 "featureWindowEnd": + err = unpopulateDateTimeRFC3339(val, "FeatureWindowEnd", &f.FeatureWindowEnd) delete(rawMsg, key) - case "sshPort": - err = unpopulate(val, "SSHPort", &h.SSHPort) + case "featureWindowStart": + err = unpopulateDateTimeRFC3339(val, "FeatureWindowStart", &f.FeatureWindowStart) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetContainer. +func (f FeaturesetContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", h.Properties) + 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 HDInsightSchema. -func (h *HDInsightSchema) UnmarshalJSON(data []byte) error { +// 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", h, err) + 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", &h.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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetContainerProperties. +func (f FeaturesetContainerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assetId", i.AssetID) - objectMap["referenceType"] = ReferenceTypeID + 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 IDAssetReference. -func (i *IDAssetReference) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "assetId": - err = unpopulate(val, "AssetID", &i.AssetID) + case "description": + err = unpopulate(val, "Description", &f.Description) delete(rawMsg, key) - case "referenceType": - err = unpopulate(val, "ReferenceType", &i.ReferenceType) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetContainerResourceArmPaginatedResult. +func (f FeaturesetContainerResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["identityType"] = i.IdentityType + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "identityType": - err = unpopulate(val, "IdentityType", &i.IdentityType) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetSpecification. +func (f FeaturesetSpecification) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "userAssignedIdentity", i.UserAssignedIdentity) + populate(objectMap, "path", f.Path) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "userAssignedIdentity": - err = unpopulate(val, "UserAssignedIdentity", &i.UserAssignedIdentity) + case "path": + err = unpopulate(val, "Path", &f.Path) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetVersion. +func (f FeaturesetVersion) 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, "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 ImageClassification. -func (i *ImageClassification) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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) + case "id": + err = unpopulate(val, "ID", &f.ID) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) + case "name": + err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &i.TrainingData) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "type": + err = unpopulate(val, "Type", &f.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetVersionBackfillRequest. +func (f FeaturesetVersionBackfillRequest) 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, "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 ImageClassificationBase. -func (i *ImageClassificationBase) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) + case "dataAvailabilityStatus": + err = unpopulate(val, "DataAvailabilityStatus", &f.DataAvailabilityStatus) delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) + case "description": + err = unpopulate(val, "Description", &f.Description) delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) + case "featureWindow": + err = unpopulate(val, "FeatureWindow", &f.FeatureWindow) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "jobId": + err = unpopulate(val, "JobID", &f.JobID) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetVersionBackfillResponse. +func (f FeaturesetVersionBackfillResponse) 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, "jobIds", f.JobIDs) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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) + case "jobIds": + err = unpopulate(val, "JobIDs", &f.JobIDs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetVersionProperties. +func (f FeaturesetVersionProperties) 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, "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 ImageInstanceSegmentation. -func (i *ImageInstanceSegmentation) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 "description": + err = unpopulate(val, "Description", &f.Description) delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) + case "entities": + err = unpopulate(val, "Entities", &f.Entities) delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &i.PrimaryMetric) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &f.IsAnonymous) delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) + case "materializationSettings": + err = unpopulate(val, "MaterializationSettings", &f.MaterializationSettings) delete(rawMsg, key) - case "targetColumnName": - err = unpopulate(val, "TargetColumnName", &i.TargetColumnName) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "taskType": - err = unpopulate(val, "TaskType", &i.TaskType) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &i.TrainingData) + case "specification": + err = unpopulate(val, "Specification", &f.Specification) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "stage": + err = unpopulate(val, "Stage", &f.Stage) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturesetVersionResourceArmPaginatedResult. +func (f FeaturesetVersionResourceArmPaginatedResult) 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, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &i.Timeout) + case "value": + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturestoreEntityContainer. +func (f FeaturestoreEntityContainer) 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, "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 ImageModelDistributionSettings. -func (i *ImageModelDistributionSettings) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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) + case "id": + err = unpopulate(val, "ID", &f.ID) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "name": + err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "type": + err = unpopulate(val, "Type", &f.Type) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + } + 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 "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "latestVersion": + err = unpopulate(val, "LatestVersion", &f.LatestVersion) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "nextVersion": + err = unpopulate(val, "NextVersion", &f.NextVersion) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturestoreEntityContainerResourceArmPaginatedResult. +func (f FeaturestoreEntityContainerResourceArmPaginatedResult) 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, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "value": + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + } + 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 "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "name": + err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "type": + err = unpopulate(val, "Type", &f.Type) delete(rawMsg, key) - case "trainingCropSize": - err = unpopulate(val, "TrainingCropSize", &i.TrainingCropSize) + } + 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, "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 "description": + err = unpopulate(val, "Description", &f.Description) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "indexColumns": + err = unpopulate(val, "IndexColumns", &f.IndexColumns) delete(rawMsg, key) - case "validationCropSize": - err = unpopulate(val, "ValidationCropSize", &i.ValidationCropSize) + case "isAnonymous": + err = unpopulate(val, "IsAnonymous", &f.IsAnonymous) delete(rawMsg, key) - case "validationResizeSize": - err = unpopulate(val, "ValidationResizeSize", &i.ValidationResizeSize) + case "isArchived": + err = unpopulate(val, "IsArchived", &f.IsArchived) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "stage": + err = unpopulate(val, "Stage", &f.Stage) delete(rawMsg, key) - case "weightedLoss": - err = unpopulate(val, "WeightedLoss", &i.WeightedLoss) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 FeaturestoreEntityVersionResourceArmPaginatedResult. +func (f FeaturestoreEntityVersionResourceArmPaginatedResult) 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, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) + case "value": + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) - case "beta1": - err = unpopulate(val, "Beta1", &i.Beta1) + } + 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) - 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) + } + 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 "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "dataContext": + err = unpopulate(val, "DataContext", &f.DataContext) delete(rawMsg, key) - case "modelSize": - err = unpopulate(val, "ModelSize", &i.ModelSize) + case "inputDataType": + err = unpopulate(val, "InputDataType", &f.InputDataType) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + case "jobInputType": + err = unpopulate(val, "JobInputType", &f.JobInputType) delete(rawMsg, key) - case "multiScale": - err = unpopulate(val, "MultiScale", &i.MultiScale) + case "uri": + err = unpopulate(val, "URI", &f.URI) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + } + 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) - case "nmsIouThreshold": - err = unpopulate(val, "NmsIouThreshold", &i.NmsIouThreshold) + } + 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) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + } + 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, "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) + 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 "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "featurizationSettings": + err = unpopulate(val, "FeaturizationSettings", &f.FeaturizationSettings) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "forecastingSettings": + err = unpopulate(val, "ForecastingSettings", &f.ForecastingSettings) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "limitSettings": + err = unpopulate(val, "LimitSettings", &f.LimitSettings) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &f.LogVerbosity) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "nCrossValidations": + f.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) delete(rawMsg, key) - case "tileGridSize": - err = unpopulate(val, "TileGridSize", &i.TileGridSize) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &f.PrimaryMetric) delete(rawMsg, key) - case "tileOverlapRatio": - err = unpopulate(val, "TileOverlapRatio", &i.TileOverlapRatio) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &f.TargetColumnName) delete(rawMsg, key) - case "tilePredictionsNmsThreshold": - err = unpopulate(val, "TilePredictionsNmsThreshold", &i.TilePredictionsNmsThreshold) + case "taskType": + err = unpopulate(val, "TaskType", &f.TaskType) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "testData": + err = unpopulate(val, "TestData", &f.TestData) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "testDataSize": + err = unpopulate(val, "TestDataSize", &f.TestDataSize) delete(rawMsg, key) - case "validationIouThreshold": - err = unpopulate(val, "ValidationIouThreshold", &i.ValidationIouThreshold) + case "trainingData": + err = unpopulate(val, "TrainingData", &f.TrainingData) delete(rawMsg, key) - case "validationMetricType": - err = unpopulate(val, "ValidationMetricType", &i.ValidationMetricType) + case "trainingSettings": + err = unpopulate(val, "TrainingSettings", &f.TrainingSettings) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "validationData": + err = unpopulate(val, "ValidationData", &f.ValidationData) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "validationDataSize": + err = unpopulate(val, "ValidationDataSize", &f.ValidationDataSize) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "weightColumnName": + err = unpopulate(val, "WeightColumnName", &f.WeightColumnName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 ForecastingSettings. +func (f ForecastingSettings) 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) + 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) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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) + case "countryOrRegionForHolidays": + err = unpopulate(val, "CountryOrRegionForHolidays", &f.CountryOrRegionForHolidays) delete(rawMsg, key) - case "checkpointRunId": - err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) + case "cvStepSize": + err = unpopulate(val, "CvStepSize", &f.CvStepSize) delete(rawMsg, key) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) + case "featureLags": + err = unpopulate(val, "FeatureLags", &f.FeatureLags) delete(rawMsg, key) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + case "forecastHorizon": + f.ForecastHorizon, err = unmarshalForecastHorizonClassification(val) delete(rawMsg, key) - case "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + case "frequency": + err = unpopulate(val, "Frequency", &f.Frequency) delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + case "seasonality": + f.Seasonality, err = unmarshalSeasonalityClassification(val) delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + case "shortSeriesHandlingConfig": + err = unpopulate(val, "ShortSeriesHandlingConfig", &f.ShortSeriesHandlingConfig) delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + case "targetAggregateFunction": + err = unpopulate(val, "TargetAggregateFunction", &f.TargetAggregateFunction) delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "targetLags": + f.TargetLags, err = unmarshalTargetLagsClassification(val) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "targetRollingWindowSize": + f.TargetRollingWindowSize, err = unmarshalTargetRollingWindowSizeClassification(val) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "timeColumnName": + err = unpopulate(val, "TimeColumnName", &f.TimeColumnName) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + case "timeSeriesIdColumnNames": + err = unpopulate(val, "TimeSeriesIDColumnNames", &f.TimeSeriesIDColumnNames) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "useStl": + err = unpopulate(val, "UseStl", &f.UseStl) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + } + 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) + 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 "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + case "blockedTrainingAlgorithms": + err = unpopulate(val, "BlockedTrainingAlgorithms", &f.BlockedTrainingAlgorithms) delete(rawMsg, key) - case "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "enableDnnTraining": + err = unpopulate(val, "EnableDnnTraining", &f.EnableDnnTraining) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "enableModelExplainability": + err = unpopulate(val, "EnableModelExplainability", &f.EnableModelExplainability) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + case "enableOnnxCompatibleModels": + err = unpopulate(val, "EnableOnnxCompatibleModels", &f.EnableOnnxCompatibleModels) delete(rawMsg, key) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + case "enableStackEnsemble": + err = unpopulate(val, "EnableStackEnsemble", &f.EnableStackEnsemble) delete(rawMsg, key) - case "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "enableVoteEnsemble": + err = unpopulate(val, "EnableVoteEnsemble", &f.EnableVoteEnsemble) delete(rawMsg, key) - case "stepLRStepSize": - err = unpopulate(val, "StepLRStepSize", &i.StepLRStepSize) + case "ensembleModelDownloadTimeout": + err = unpopulate(val, "EnsembleModelDownloadTimeout", &f.EnsembleModelDownloadTimeout) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "stackEnsembleSettings": + err = unpopulate(val, "StackEnsembleSettings", &f.StackEnsembleSettings) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + } + 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 "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "destination": + err = unpopulate(val, "Destination", &f.Destination) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "status": + err = unpopulate(val, "Status", &f.Status) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "type": + err = unpopulate(val, "Type", &f.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", f, 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 GetBlobReferenceForConsumptionDto. +func (g GetBlobReferenceForConsumptionDto) 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, "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 ImageModelSettingsClassification. -func (i *ImageModelSettingsClassification) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "advancedSettings": - err = unpopulate(val, "AdvancedSettings", &i.AdvancedSettings) + case "blobUri": + err = unpopulate(val, "BlobURI", &g.BlobURI) delete(rawMsg, key) - case "amsGradient": - err = unpopulate(val, "AmsGradient", &i.AmsGradient) + case "credential": + g.Credential, err = unmarshalDataReferenceCredentialClassification(val) delete(rawMsg, key) - case "augmentations": - err = unpopulate(val, "Augmentations", &i.Augmentations) + case "storageAccountArmId": + err = unpopulate(val, "StorageAccountArmID", &g.StorageAccountArmID) 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) + } + 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 "checkpointModel": - err = unpopulate(val, "CheckpointModel", &i.CheckpointModel) + case "blobUri": + err = unpopulate(val, "BlobURI", &g.BlobURI) delete(rawMsg, key) - case "checkpointRunId": - err = unpopulate(val, "CheckpointRunID", &i.CheckpointRunID) + } + 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) - case "distributed": - err = unpopulate(val, "Distributed", &i.Distributed) + } + 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) - case "earlyStopping": - err = unpopulate(val, "EarlyStopping", &i.EarlyStopping) + } + 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 "earlyStoppingDelay": - err = unpopulate(val, "EarlyStoppingDelay", &i.EarlyStoppingDelay) + case "computeType": + err = unpopulate(val, "ComputeType", &h.ComputeType) delete(rawMsg, key) - case "earlyStoppingPatience": - err = unpopulate(val, "EarlyStoppingPatience", &i.EarlyStoppingPatience) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &h.CreatedOn) delete(rawMsg, key) - case "enableOnnxNormalization": - err = unpopulate(val, "EnableOnnxNormalization", &i.EnableOnnxNormalization) + case "description": + err = unpopulate(val, "Description", &h.Description) delete(rawMsg, key) - case "evaluationFrequency": - err = unpopulate(val, "EvaluationFrequency", &i.EvaluationFrequency) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &h.DisableLocalAuth) delete(rawMsg, key) - case "gradientAccumulationStep": - err = unpopulate(val, "GradientAccumulationStep", &i.GradientAccumulationStep) + case "isAttachedCompute": + err = unpopulate(val, "IsAttachedCompute", &h.IsAttachedCompute) delete(rawMsg, key) - case "layersToFreeze": - err = unpopulate(val, "LayersToFreeze", &i.LayersToFreeze) + case "modifiedOn": + err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &h.ModifiedOn) delete(rawMsg, key) - case "learningRate": - err = unpopulate(val, "LearningRate", &i.LearningRate) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) delete(rawMsg, key) - case "learningRateScheduler": - err = unpopulate(val, "LearningRateScheduler", &i.LearningRateScheduler) + case "provisioningErrors": + err = unpopulate(val, "ProvisioningErrors", &h.ProvisioningErrors) delete(rawMsg, key) - case "modelName": - err = unpopulate(val, "ModelName", &i.ModelName) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &h.ProvisioningState) delete(rawMsg, key) - case "momentum": - err = unpopulate(val, "Momentum", &i.Momentum) + case "resourceId": + err = unpopulate(val, "ResourceID", &h.ResourceID) delete(rawMsg, key) - case "nesterov": - err = unpopulate(val, "Nesterov", &i.Nesterov) + } + 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 "numberOfEpochs": - err = unpopulate(val, "NumberOfEpochs", &i.NumberOfEpochs) + case "administratorAccount": + err = unpopulate(val, "AdministratorAccount", &h.AdministratorAccount) delete(rawMsg, key) - case "numberOfWorkers": - err = unpopulate(val, "NumberOfWorkers", &i.NumberOfWorkers) + case "sshPort": + err = unpopulate(val, "SSHPort", &h.SSHPort) delete(rawMsg, key) - case "optimizer": - err = unpopulate(val, "Optimizer", &i.Optimizer) + } + 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) - case "randomSeed": - err = unpopulate(val, "RandomSeed", &i.RandomSeed) + } + 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 "stepLRGamma": - err = unpopulate(val, "StepLRGamma", &i.StepLRGamma) + case "referenceType": + err = unpopulate(val, "ReferenceType", &i.ReferenceType) delete(rawMsg, key) - case "stepLRStepSize": + } + 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) + 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) + 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) + 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) + } + 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, "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) + 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 "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + 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 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 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 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, "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 "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, "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 "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 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 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, "userStorageKey", l.UserStorageKey) + populate(objectMap, "userStorageResourceId", l.UserStorageResourceID) + 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 "userStorageKey": + err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + delete(rawMsg, key) + case "userStorageResourceId": + err = unpopulate(val, "UserStorageResourceID", &l.UserStorageResourceID) + 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 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, "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 "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) + 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) + 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 "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 "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 "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, "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 "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, "group", m.Group) + populate(objectMap, "isSharedToAll", m.IsSharedToAll) + populate(objectMap, "metadata", m.Metadata) + populate(objectMap, "sharedUserList", m.SharedUserList) + populate(objectMap, "target", m.Target) + populate(objectMap, "value", m.Value) + populate(objectMap, "valueFormat", m.ValueFormat) + 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 "group": + err = unpopulate(val, "Group", &m.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &m.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &m.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &m.ValueFormat) + 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, "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 "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 MarketplacePlan. +func (m MarketplacePlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offerId", m.OfferID) + populate(objectMap, "planId", m.PlanID) + populate(objectMap, "publisherId", m.PublisherID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplacePlan. +func (m *MarketplacePlan) UnmarshalJSON(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 "offerId": + err = unpopulate(val, "OfferID", &m.OfferID) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &m.PlanID) + delete(rawMsg, key) + case "publisherId": + err = unpopulate(val, "PublisherID", &m.PublisherID) + 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 MarketplaceSubscription. +func (m MarketplaceSubscription) 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 MarketplaceSubscription. +func (m *MarketplaceSubscription) UnmarshalJSON(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 MarketplaceSubscriptionProperties. +func (m MarketplaceSubscriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "marketplacePlan", m.MarketplacePlan) + populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) + populate(objectMap, "modelId", m.ModelID) + populate(objectMap, "provisioningState", m.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceSubscriptionProperties. +func (m *MarketplaceSubscriptionProperties) UnmarshalJSON(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 "marketplacePlan": + err = unpopulate(val, "MarketplacePlan", &m.MarketplacePlan) + delete(rawMsg, key) + case "marketplaceSubscriptionStatus": + err = unpopulate(val, "MarketplaceSubscriptionStatus", &m.MarketplaceSubscriptionStatus) + delete(rawMsg, key) + case "modelId": + err = unpopulate(val, "ModelID", &m.ModelID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + 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 MarketplaceSubscriptionResourceArmPaginatedResult. +func (m MarketplaceSubscriptionResourceArmPaginatedResult) 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 MarketplaceSubscriptionResourceArmPaginatedResult. +func (m *MarketplaceSubscriptionResourceArmPaginatedResult) UnmarshalJSON(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 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 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 ModelSettings. +func (m ModelSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "modelId", m.ModelID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ModelSettings. +func (m *ModelSettings) UnmarshalJSON(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 "modelId": + err = unpopulate(val, "ModelID", &m.ModelID) + 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, "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, "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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "flavors": + err = unpopulate(val, "Flavors", &m.Flavors) + 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 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 "trainingCropSize": - err = unpopulate(val, "TrainingCropSize", &i.TrainingCropSize) + case "signalType": + err = unpopulate(val, "SignalType", &m.SignalType) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + } + 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 "validationCropSize": - err = unpopulate(val, "ValidationCropSize", &i.ValidationCropSize) + 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 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 NlpVertical. +func (n NlpVertical) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "featurizationSettings", n.FeaturizationSettings) + populate(objectMap, "limitSettings", n.LimitSettings) + 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 "limitSettings": + err = unpopulate(val, "LimitSettings", &n.LimitSettings) + 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, "maxTrials", n.MaxTrials) + populate(objectMap, "timeout", n.Timeout) + 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 "maxTrials": + err = unpopulate(val, "MaxTrials", &n.MaxTrials) + delete(rawMsg, key) + case "timeout": + err = unpopulate(val, "Timeout", &n.Timeout) + 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 "validationResizeSize": - err = unpopulate(val, "ValidationResizeSize", &i.ValidationResizeSize) + case "leavingNodeCount": + err = unpopulate(val, "LeavingNodeCount", &n.LeavingNodeCount) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "preemptedNodeCount": + err = unpopulate(val, "PreemptedNodeCount", &n.PreemptedNodeCount) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "preparingNodeCount": + err = unpopulate(val, "PreparingNodeCount", &n.PreparingNodeCount) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "runningNodeCount": + err = unpopulate(val, "RunningNodeCount", &n.RunningNodeCount) delete(rawMsg, key) - case "weightedLoss": - err = unpopulate(val, "WeightedLoss", &i.WeightedLoss) + case "unusableNodeCount": + err = unpopulate(val, "UnusableNodeCount", &n.UnusableNodeCount) 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 ImageModelSettingsObjectDetection. -func (i ImageModelSettingsObjectDetection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Nodes. +func (n Nodes) 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) + objectMap["nodesValueType"] = n.NodesValueType 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 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", 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 "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) - 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) + case "nodesValueType": + err = unpopulate(val, "NodesValueType", &n.NodesValueType) 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) + } + 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, "group", n.Group) + populate(objectMap, "isSharedToAll", n.IsSharedToAll) + populate(objectMap, "metadata", n.Metadata) + populate(objectMap, "sharedUserList", n.SharedUserList) + populate(objectMap, "target", n.Target) + populate(objectMap, "value", n.Value) + populate(objectMap, "valueFormat", n.ValueFormat) + 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 "tileGridSize": - err = unpopulate(val, "TileGridSize", &i.TileGridSize) + case "category": + err = unpopulate(val, "Category", &n.Category) delete(rawMsg, key) - case "tileOverlapRatio": - err = unpopulate(val, "TileOverlapRatio", &i.TileOverlapRatio) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &n.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "tilePredictionsNmsThreshold": - err = unpopulate(val, "TilePredictionsNmsThreshold", &i.TilePredictionsNmsThreshold) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &n.ExpiryTime) delete(rawMsg, key) - case "trainingBatchSize": - err = unpopulate(val, "TrainingBatchSize", &i.TrainingBatchSize) + case "group": + err = unpopulate(val, "Group", &n.Group) delete(rawMsg, key) - case "validationBatchSize": - err = unpopulate(val, "ValidationBatchSize", &i.ValidationBatchSize) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &n.IsSharedToAll) delete(rawMsg, key) - case "validationIouThreshold": - err = unpopulate(val, "ValidationIouThreshold", &i.ValidationIouThreshold) + case "metadata": + err = unpopulate(val, "Metadata", &n.Metadata) delete(rawMsg, key) - case "validationMetricType": - err = unpopulate(val, "ValidationMetricType", &i.ValidationMetricType) + case "sharedUserList": + err = unpopulate(val, "SharedUserList", &n.SharedUserList) delete(rawMsg, key) - case "warmupCosineLRCycles": - err = unpopulate(val, "WarmupCosineLRCycles", &i.WarmupCosineLRCycles) + case "target": + err = unpopulate(val, "Target", &n.Target) delete(rawMsg, key) - case "warmupCosineLRWarmupEpochs": - err = unpopulate(val, "WarmupCosineLRWarmupEpochs", &i.WarmupCosineLRWarmupEpochs) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) - case "weightDecay": - err = unpopulate(val, "WeightDecay", &i.WeightDecay) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &n.ValueFormat) 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 ImageObjectDetection. -func (i ImageObjectDetection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NoneDatastoreCredentials. +func (n NoneDatastoreCredentials) 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["credentialsType"] = CredentialsTypeNone 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &n.CredentialsType) 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 ImageObjectDetectionBase. -func (i ImageObjectDetectionBase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookAccessTokenResult. +func (n NotebookAccessTokenResult) 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, "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 ImageObjectDetectionBase. -func (i *ImageObjectDetectionBase) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "limitSettings": - err = unpopulate(val, "LimitSettings", &i.LimitSettings) + case "accessToken": + err = unpopulate(val, "AccessToken", &n.AccessToken) delete(rawMsg, key) - case "modelSettings": - err = unpopulate(val, "ModelSettings", &i.ModelSettings) + case "expiresIn": + err = unpopulate(val, "ExpiresIn", &n.ExpiresIn) delete(rawMsg, key) - case "searchSpace": - err = unpopulate(val, "SearchSpace", &i.SearchSpace) + case "hostName": + err = unpopulate(val, "HostName", &n.HostName) delete(rawMsg, key) - case "sweepSettings": - err = unpopulate(val, "SweepSettings", &i.SweepSettings) + case "notebookResourceId": + err = unpopulate(val, "NotebookResourceID", &n.NotebookResourceID) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "publicDns": + err = unpopulate(val, "PublicDNS", &n.PublicDNS) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "refreshToken": + err = unpopulate(val, "RefreshToken", &n.RefreshToken) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &n.Scope) + delete(rawMsg, key) + case "tokenType": + err = unpopulate(val, "TokenType", &n.TokenType) 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 ImageSweepSettings. -func (i ImageSweepSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookPreparationError. +func (n NotebookPreparationError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "earlyTermination", i.EarlyTermination) - populate(objectMap, "samplingAlgorithm", i.SamplingAlgorithm) + populate(objectMap, "errorMessage", n.ErrorMessage) + populate(objectMap, "statusCode", n.StatusCode) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "earlyTermination": - i.EarlyTermination, err = unmarshalEarlyTerminationPolicyClassification(val) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &n.ErrorMessage) delete(rawMsg, key) - case "samplingAlgorithm": - err = unpopulate(val, "SamplingAlgorithm", &i.SamplingAlgorithm) + case "statusCode": + err = unpopulate(val, "StatusCode", &n.StatusCode) 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 ImageVertical. -func (i ImageVertical) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotebookResourceInfo. +func (n NotebookResourceInfo) 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, "fqdn", n.Fqdn) + populate(objectMap, "notebookPreparationError", n.NotebookPreparationError) + populate(objectMap, "resourceId", n.ResourceID) 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 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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) + case "fqdn": + err = unpopulate(val, "Fqdn", &n.Fqdn) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &i.ValidationData) + case "notebookPreparationError": + err = unpopulate(val, "NotebookPreparationError", &n.NotebookPreparationError) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &i.ValidationDataSize) + case "resourceId": + err = unpopulate(val, "ResourceID", &n.ResourceID) 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 InferenceContainerProperties. -func (i InferenceContainerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationSetting. +func (n NotificationSetting) 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, "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 InferenceContainerProperties. -func (i *InferenceContainerProperties) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "livenessRoute": - err = unpopulate(val, "LivenessRoute", &i.LivenessRoute) + case "emailOn": + err = unpopulate(val, "EmailOn", &n.EmailOn) delete(rawMsg, key) - case "readinessRoute": - err = unpopulate(val, "ReadinessRoute", &i.ReadinessRoute) + case "emails": + err = unpopulate(val, "Emails", &n.Emails) delete(rawMsg, key) - case "scoringRoute": - err = unpopulate(val, "ScoringRoute", &i.ScoringRoute) + case "webhooks": + n.Webhooks, err = unmarshalWebhookClassificationMap(val) 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 InstanceTypeSchema. -func (i InstanceTypeSchema) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NumericalDataDriftMetricThreshold. +func (n NumericalDataDriftMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nodeSelector", i.NodeSelector) - populate(objectMap, "resources", i.Resources) + 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 InstanceTypeSchema. -func (i *InstanceTypeSchema) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "nodeSelector": - err = unpopulate(val, "NodeSelector", &i.NodeSelector) + case "dataType": + err = unpopulate(val, "DataType", &n.DataType) delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &i.Resources) + case "metric": + err = unpopulate(val, "Metric", &n.Metric) + delete(rawMsg, key) + 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 InstanceTypeSchemaResources. -func (i InstanceTypeSchemaResources) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NumericalDataQualityMetricThreshold. +func (n NumericalDataQualityMetricThreshold) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "limits", i.Limits) - populate(objectMap, "requests", i.Requests) + 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 InstanceTypeSchemaResources. -func (i *InstanceTypeSchemaResources) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "limits": - err = unpopulate(val, "Limits", &i.Limits) + case "dataType": + err = unpopulate(val, "DataType", &n.DataType) delete(rawMsg, key) - case "requests": - err = unpopulate(val, "Requests", &i.Requests) + case "metric": + err = unpopulate(val, "Metric", &n.Metric) + delete(rawMsg, key) + 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 JobBase. -func (j JobBase) 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, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "systemData", j.SystemData) - populate(objectMap, "type", j.Type) + 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 JobBase. -func (j *JobBase) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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) + case "dataType": + err = unpopulate(val, "DataType", &n.DataType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &j.SystemData) + case "metric": + err = unpopulate(val, "Metric", &n.Metric) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "threshold": + err = unpopulate(val, "Threshold", &n.Threshold) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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 OAuth2AuthTypeWorkspaceConnectionProperties. +func (o OAuth2AuthTypeWorkspaceConnectionProperties) 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["authType"] = ConnectionAuthTypeOAuth2 + populate(objectMap, "category", o.Category) + populate(objectMap, "createdByWorkspaceArmId", o.CreatedByWorkspaceArmID) + populate(objectMap, "credentials", o.Credentials) + populateDateTimeRFC3339(objectMap, "expiryTime", o.ExpiryTime) + populate(objectMap, "group", o.Group) + populate(objectMap, "isSharedToAll", o.IsSharedToAll) + populate(objectMap, "metadata", o.Metadata) + populate(objectMap, "sharedUserList", o.SharedUserList) + populate(objectMap, "target", o.Target) + populate(objectMap, "value", o.Value) + populate(objectMap, "valueFormat", o.ValueFormat) 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 OAuth2AuthTypeWorkspaceConnectionProperties. +func (o *OAuth2AuthTypeWorkspaceConnectionProperties) UnmarshalJSON(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", o, err) } for key, val := range rawMsg { var err error switch key { - case "componentId": - err = unpopulate(val, "ComponentID", &j.ComponentID) + case "authType": + err = unpopulate(val, "AuthType", &o.AuthType) delete(rawMsg, key) - case "computeId": - err = unpopulate(val, "ComputeID", &j.ComputeID) + case "category": + err = unpopulate(val, "Category", &o.Category) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &j.Description) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &o.CreatedByWorkspaceArmID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &j.DisplayName) + case "credentials": + err = unpopulate(val, "Credentials", &o.Credentials) delete(rawMsg, key) - case "experimentName": - err = unpopulate(val, "ExperimentName", &j.ExperimentName) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &o.ExpiryTime) delete(rawMsg, key) - case "identity": - j.Identity, err = unmarshalIdentityConfigurationClassification(val) + case "group": + err = unpopulate(val, "Group", &o.Group) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &j.IsArchived) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &o.IsSharedToAll) delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &j.JobType) + case "metadata": + err = unpopulate(val, "Metadata", &o.Metadata) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) + case "sharedUserList": + err = unpopulate(val, "SharedUserList", &o.SharedUserList) delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &j.Services) + case "target": + err = unpopulate(val, "Target", &o.Target) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &o.ValueFormat) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 Objective. +func (o Objective) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + populate(objectMap, "goal", o.Goal) + populate(objectMap, "primaryMetric", o.PrimaryMetric) 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 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", j, err) + 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", &j.NextLink) + case "goal": + err = unpopulate(val, "Goal", &o.Goal) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &o.PrimaryMetric) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OneLakeArtifact. +func (o OneLakeArtifact) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", j.Description) - objectMap["jobInputType"] = j.JobInputType + populate(objectMap, "artifactName", o.ArtifactName) + objectMap["artifactType"] = o.ArtifactType 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 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", j, err) + 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", &j.Description) + case "artifactName": + err = unpopulate(val, "ArtifactName", &o.ArtifactName) delete(rawMsg, key) - case "jobInputType": - err = unpopulate(val, "JobInputType", &j.JobInputType) + case "artifactType": + err = unpopulate(val, "ArtifactType", &o.ArtifactType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OneLakeDatastore. +func (o OneLakeDatastore) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["jobLimitsType"] = j.JobLimitsType - populate(objectMap, "timeout", j.Timeout) + 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, "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 JobLimits. -func (j *JobLimits) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "jobLimitsType": - err = unpopulate(val, "JobLimitsType", &j.JobLimitsType) + case "artifact": + o.Artifact, err = unmarshalOneLakeArtifactClassification(val) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &j.Timeout) + case "credentials": + o.Credentials, err = unmarshalDatastoreCredentialsClassification(val) + delete(rawMsg, key) + case "datastoreType": + err = unpopulate(val, "DatastoreType", &o.DatastoreType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &o.Endpoint) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &o.IsDefault) + delete(rawMsg, key) + case "oneLakeWorkspaceName": + err = unpopulate(val, "OneLakeWorkspaceName", &o.OneLakeWorkspaceName) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "serviceDataAccessAuthIdentity": + err = unpopulate(val, "ServiceDataAccessAuthIdentity", &o.ServiceDataAccessAuthIdentity) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OnlineDeployment. +func (o OnlineDeployment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", j.Description) - objectMap["jobOutputType"] = j.JobOutputType + 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 JobOutput. -func (j *JobOutput) 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", j, err) + 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", &j.Description) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "jobOutputType": - err = unpopulate(val, "JobOutputType", &j.JobOutputType) + case "identity": + err = unpopulate(val, "Identity", &o.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &o.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + o.Properties, err = unmarshalOnlineDeploymentPropertiesClassification(val) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &o.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OnlineDeploymentProperties. +func (o OnlineDeploymentProperties) 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, "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 JobResourceConfiguration. -func (j *JobResourceConfiguration) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "dockerArgs": - err = unpopulate(val, "DockerArgs", &j.DockerArgs) + case "appInsightsEnabled": + err = unpopulate(val, "AppInsightsEnabled", &o.AppInsightsEnabled) delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &j.InstanceCount) + case "codeConfiguration": + err = unpopulate(val, "CodeConfiguration", &o.CodeConfiguration) + delete(rawMsg, key) + case "dataCollector": + err = unpopulate(val, "DataCollector", &o.DataCollector) + 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", &j.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) + delete(rawMsg, key) + case "modelMountPath": + err = unpopulate(val, "ModelMountPath", &o.ModelMountPath) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "shmSize": - err = unpopulate(val, "ShmSize", &j.ShmSize) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &o.ReadinessProbe) + delete(rawMsg, key) + case "requestSettings": + err = unpopulate(val, "RequestSettings", &o.RequestSettings) + delete(rawMsg, key) + case "scaleSettings": + o.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OnlineDeploymentTrackedResourceArmPaginatedResult. +func (o OnlineDeploymentTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["actionType"] = ScheduleActionTypeCreateJob - populate(objectMap, "jobDefinition", j.JobDefinition) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) 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 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", j, err) + 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", &j.ActionType) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "jobDefinition": - j.JobDefinition, err = unmarshalJobBasePropertiesClassification(val) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OnlineEndpoint. +func (o OnlineEndpoint) 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, "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 JobService. -func (j *JobService) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "endpoint": - err = unpopulate(val, "Endpoint", &j.Endpoint) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &j.ErrorMessage) + case "identity": + err = unpopulate(val, "Identity", &o.Identity) delete(rawMsg, key) - case "jobServiceType": - err = unpopulate(val, "JobServiceType", &j.JobServiceType) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &j.Port) + case "location": + err = unpopulate(val, "Location", &o.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "sku": + err = unpopulate(val, "SKU", &o.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &o.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OnlineEndpointProperties. +func (o OnlineEndpointProperties) 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) + 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 Kubernetes. -func (k *Kubernetes) UnmarshalJSON(data []byte) error { +// 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) + case "authMode": + err = unpopulate(val, "AuthMode", &o.AuthMode) delete(rawMsg, key) - case "createdOn": - err = unpopulateDateTimeRFC3339(val, "CreatedOn", &k.CreatedOn) + case "compute": + err = unpopulate(val, "Compute", &o.Compute) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &k.Description) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &k.DisableLocalAuth) + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "isAttachedCompute": - err = unpopulate(val, "IsAttachedCompute", &k.IsAttachedCompute) + case "keys": + err = unpopulate(val, "Keys", &o.Keys) delete(rawMsg, key) - case "modifiedOn": - err = unpopulateDateTimeRFC3339(val, "ModifiedOn", &k.ModifiedOn) + case "mirrorTraffic": + err = unpopulate(val, "MirrorTraffic", &o.MirrorTraffic) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &k.Properties) - delete(rawMsg, key) - case "provisioningErrors": - err = unpopulate(val, "ProvisioningErrors", &k.ProvisioningErrors) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &k.ResourceID) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &o.PublicNetworkAccess) + delete(rawMsg, key) + case "scoringUri": + err = unpopulate(val, "ScoringURI", &o.ScoringURI) + delete(rawMsg, key) + case "swaggerUri": + err = unpopulate(val, "SwaggerURI", &o.SwaggerURI) + delete(rawMsg, key) + case "traffic": + err = unpopulate(val, "Traffic", &o.Traffic) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OnlineEndpointTrackedResourceArmPaginatedResult. +func (o OnlineEndpointTrackedResourceArmPaginatedResult) 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, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) 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 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", k, err) + 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", &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) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &k.Properties) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + } + 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 "readinessProbe": - err = unpopulate(val, "ReadinessProbe", &k.ReadinessProbe) + case "maxQueueWait": + err = unpopulate(val, "MaxQueueWait", &o.MaxQueueWait) delete(rawMsg, key) - case "requestSettings": - err = unpopulate(val, "RequestSettings", &k.RequestSettings) + case "requestTimeout": + err = unpopulate(val, "RequestTimeout", &o.RequestTimeout) delete(rawMsg, key) - case "scaleSettings": - k.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OnlineScaleSettings. +func (o OnlineScaleSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["scaleType"] = o.ScaleType + return json.Marshal(objectMap) +} + +// 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scaleType": + err = unpopulate(val, "ScaleType", &o.ScaleType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 Operation. +func (o Operation) 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, "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 KubernetesProperties. -func (k *KubernetesProperties) UnmarshalJSON(data []byte) error { +// 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) delete(rawMsg, key) - case "namespace": - err = unpopulate(val, "Namespace", &k.Namespace) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "relayConnectionString": - err = unpopulate(val, "RelayConnectionString", &k.RelayConnectionString) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) delete(rawMsg, key) - case "serviceBusConnectionString": - err = unpopulate(val, "ServiceBusConnectionString", &k.ServiceBusConnectionString) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "vcName": - err = unpopulate(val, "VcName", &k.VcName) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", k.Properties) + 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 KubernetesSchema. -func (k *KubernetesSchema) UnmarshalJSON(data []byte) error { +// 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &k.Properties) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) 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 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", l, err) + 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", &l.NextLink) + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OutboundRule. +func (o OutboundRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "primaryAccessKey", l.PrimaryAccessKey) - populate(objectMap, "secondaryAccessKey", l.SecondaryAccessKey) + 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 ListNotebookKeysResult. -func (l *ListNotebookKeysResult) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "primaryAccessKey": - err = unpopulate(val, "PrimaryAccessKey", &l.PrimaryAccessKey) + case "category": + err = unpopulate(val, "Category", &o.Category) delete(rawMsg, key) - case "secondaryAccessKey": - err = unpopulate(val, "SecondaryAccessKey", &l.SecondaryAccessKey) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OutboundRuleBasicResource. +func (o OutboundRuleBasicResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "userStorageKey", l.UserStorageKey) + 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 ListStorageAccountKeysResult. -func (l *ListStorageAccountKeysResult) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "userStorageKey": - err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + o.Properties, err = unmarshalOutboundRuleClassification(val) + delete(rawMsg, key) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OutboundRuleListResult. +func (o OutboundRuleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) 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 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", l, err) + 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", &l.NextLink) + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OutputPathAssetReference. +func (o OutputPathAssetReference) 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, "jobId", o.JobID) + populate(objectMap, "path", o.Path) + objectMap["referenceType"] = ReferenceTypeOutputPath 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 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) + case "jobId": + err = unpopulate(val, "JobID", &o.JobID) delete(rawMsg, key) - case "userStorageKey": - err = unpopulate(val, "UserStorageKey", &l.UserStorageKey) + case "path": + err = unpopulate(val, "Path", &o.Path) delete(rawMsg, key) - case "userStorageResourceId": - err = unpopulate(val, "UserStorageResourceID", &l.UserStorageResourceID) + case "referenceType": + err = unpopulate(val, "ReferenceType", &o.ReferenceType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 PATAuthTypeWorkspaceConnectionProperties. +func (p PATAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + 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, "group", p.Group) + populate(objectMap, "isSharedToAll", p.IsSharedToAll) + populate(objectMap, "metadata", p.Metadata) + populate(objectMap, "sharedUserList", p.SharedUserList) + populate(objectMap, "target", p.Target) + populate(objectMap, "value", p.Value) + populate(objectMap, "valueFormat", p.ValueFormat) 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 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", 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 "authType": + err = unpopulate(val, "AuthType", &p.AuthType) + delete(rawMsg, key) + 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 "group": + err = unpopulate(val, "Group", &p.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &p.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &p.Target) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &p.ValueFormat) 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 PaginatedComputeResourcesList. +func (p PaginatedComputeResourcesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", l.Description) - objectMap["jobInputType"] = JobInputTypeLiteral - populate(objectMap, "value", l.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) 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 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", 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) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) 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 MLFlowModelJobInput. -func (m MLFlowModelJobInput) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialBatchDeployment. +func (p PartialBatchDeployment) 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, "description", p.Description) 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 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", 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) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &m.Mode) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + err = unpopulate(val, "Description", &p.Description) 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 PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. +func (p PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) 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, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) 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 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", 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) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "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 MLTableData. -func (m MLTableData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialManagedServiceIdentity. +func (p PartialManagedServiceIdentity) 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, "type", p.Type) + populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) 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 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", 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) - 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 "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) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &p.UserAssignedIdentities) 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 PartialMinimalTrackedResource. +func (p PartialMinimalTrackedResource) 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, "tags", p.Tags) 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 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", 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) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &m.Mode) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "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 MLTableJobOutput. -func (m MLTableJobOutput) 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, "description", m.Description) - objectMap["jobOutputType"] = JobOutputTypeMltable - populate(objectMap, "mode", m.Mode) - populate(objectMap, "uri", m.URI) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "tags", p.Tags) 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 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", 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) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) + case "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 ManagedIdentity. -func (m ManagedIdentity) 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, "clientId", m.ClientID) - objectMap["identityType"] = IdentityConfigurationTypeManaged - populate(objectMap, "objectId", m.ObjectID) - populate(objectMap, "resourceId", m.ResourceID) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "tags", p.Tags) 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 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", 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) - delete(rawMsg, key) - case "identityType": - err = unpopulate(val, "IdentityType", &m.IdentityType) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &m.ObjectID) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &m.ResourceID) + case "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 ManagedIdentityAuthTypeWorkspaceConnectionProperties. -func (m ManagedIdentityAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialMinimalTrackedResourceWithSKUAndIdentity. +func (p PartialMinimalTrackedResourceWithSKUAndIdentity) 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) + 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 ManagedIdentityAuthTypeWorkspaceConnectionProperties. -func (m *ManagedIdentityAuthTypeWorkspaceConnectionProperties) 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", 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) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &m.ValueFormat) + case "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 ManagedOnlineDeployment. -func (m ManagedOnlineDeployment) 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, "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, "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 ManagedOnlineDeployment. -func (m *ManagedOnlineDeployment) 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", 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) - 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) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "requestSettings": - err = unpopulate(val, "RequestSettings", &m.RequestSettings) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "scaleSettings": - m.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + case "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 ManagedServiceIdentity. -func (m ManagedServiceIdentity) 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, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + 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 ManagedServiceIdentity. -func (m *ManagedServiceIdentity) 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", 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 "capacity": + err = unpopulate(val, "Capacity", &p.Capacity) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "family": + err = unpopulate(val, "Family", &p.Family) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + case "size": + err = unpopulate(val, "Size", &p.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &p.Tier) 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 Password. +func (p Password) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "delayEvaluation", m.DelayEvaluation) - populate(objectMap, "evaluationInterval", m.EvaluationInterval) - objectMap["policyType"] = EarlyTerminationPolicyTypeMedianStopping + populate(objectMap, "name", p.Name) + 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 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", 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) + case "name": + err = unpopulate(val, "Name", &p.Name) 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 PendingUploadCredentialDto. +func (p PendingUploadCredentialDto) 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) + objectMap["credentialType"] = p.CredentialType 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 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", 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) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "credentialType": + err = unpopulate(val, "CredentialType", &p.CredentialType) 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 PendingUploadRequestDto. +func (p PendingUploadRequestDto) 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, "pendingUploadId", p.PendingUploadID) + populate(objectMap, "pendingUploadType", p.PendingUploadType) 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 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 "isArchived": - err = unpopulate(val, "IsArchived", &m.IsArchived) + case "pendingUploadId": + err = unpopulate(val, "PendingUploadID", &p.PendingUploadID) 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 "tags": - err = unpopulate(val, "Tags", &m.Tags) + 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 ModelContainerResourceArmPaginatedResult. -func (m ModelContainerResourceArmPaginatedResult) 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, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + 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 ModelContainerResourceArmPaginatedResult. -func (m *ModelContainerResourceArmPaginatedResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "blobReferenceForConsumption": + err = unpopulate(val, "BlobReferenceForConsumption", &p.BlobReferenceForConsumption) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "pendingUploadId": + err = unpopulate(val, "PendingUploadID", &p.PendingUploadID) + delete(rawMsg, key) + 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 ModelVersion. -func (m ModelVersion) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PersonalComputeInstanceSettings. +func (p PersonalComputeInstanceSettings) 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, "assignedUser", p.AssignedUser) 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 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", 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) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + 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 ModelVersionProperties. -func (m ModelVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineJob. +func (p PipelineJob) 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, "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, "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 ModelVersionProperties. -func (m *ModelVersionProperties) 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 "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", &m.Description) + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "flavors": - err = unpopulate(val, "Flavors", &m.Flavors) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) - case "isAnonymous": - err = unpopulate(val, "IsAnonymous", &m.IsAnonymous) + 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 "jobName": - err = unpopulate(val, "JobName", &m.JobName) + case "jobType": + err = unpopulate(val, "JobType", &p.JobType) delete(rawMsg, key) - case "modelType": - err = unpopulate(val, "ModelType", &m.ModelType) + case "jobs": + err = unpopulate(val, "Jobs", &p.Jobs) delete(rawMsg, key) - case "modelUri": - err = unpopulate(val, "ModelURI", &m.ModelURI) + 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 "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 ModelVersionResourceArmPaginatedResult. -func (m ModelVersionResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PredictionDriftMetricThresholdBase. +func (p PredictionDriftMetricThresholdBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + objectMap["dataType"] = p.DataType + populate(objectMap, "threshold", p.Threshold) 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 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 "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "dataType": + err = unpopulate(val, "DataType", &p.DataType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + 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 Mpi. -func (m Mpi) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PredictionDriftMonitoringSignal. +func (p PredictionDriftMonitoringSignal) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["distributionType"] = DistributionTypeMpi - populate(objectMap, "processCountPerInstance", m.ProcessCountPerInstance) + 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 Mpi. -func (m *Mpi) 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 "distributionType": - err = unpopulate(val, "DistributionType", &m.DistributionType) + case "featureDataTypeOverride": + err = unpopulate(val, "FeatureDataTypeOverride", &p.FeatureDataTypeOverride) delete(rawMsg, key) - case "processCountPerInstance": - err = unpopulate(val, "ProcessCountPerInstance", &m.ProcessCountPerInstance) + case "metricThresholds": + p.MetricThresholds, err = unmarshalPredictionDriftMetricThresholdBaseClassificationArray(val) + delete(rawMsg, key) + case "notificationTypes": + err = unpopulate(val, "NotificationTypes", &p.NotificationTypes) + delete(rawMsg, key) + case "productionData": + p.ProductionData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "referenceData": + p.ReferenceData, err = unmarshalMonitoringInputDataBaseClassification(val) + delete(rawMsg, key) + case "signalType": + err = unpopulate(val, "SignalType", &p.SignalType) 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 PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = n.Mode + populate(objectMap, "id", p.ID) 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 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", 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 "id": + err = unpopulate(val, "ID", &p.ID) 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 PrivateEndpointConnection. +func (p PrivateEndpointConnection) 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, "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 NlpVertical. -func (n *NlpVertical) 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", 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 "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "limitSettings": - err = unpopulate(val, "LimitSettings", &n.LimitSettings) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &n.ValidationData) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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) + delete(rawMsg, key) + 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 NlpVerticalFeaturizationSettings. -func (n NlpVerticalFeaturizationSettings) 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, "datasetLanguage", n.DatasetLanguage) + populate(objectMap, "value", p.Value) 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 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", 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 "value": + err = unpopulate(val, "Value", &p.Value) 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 PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) 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, "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 NlpVerticalLimitSettings. -func (n *NlpVerticalLimitSettings) 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", 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) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "maxTrials": - err = unpopulate(val, "MaxTrials", &n.MaxTrials) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &n.Timeout) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) 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 PrivateEndpointDestination. +func (p PrivateEndpointDestination) 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, "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 NodeStateCounts. -func (n *NodeStateCounts) 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", 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 "serviceResourceId": + err = unpopulate(val, "ServiceResourceID", &p.ServiceResourceID) delete(rawMsg, key) - case "preparingNodeCount": - err = unpopulate(val, "PreparingNodeCount", &n.PreparingNodeCount) + case "sparkEnabled": + err = unpopulate(val, "SparkEnabled", &p.SparkEnabled) delete(rawMsg, key) - case "runningNodeCount": - err = unpopulate(val, "RunningNodeCount", &n.RunningNodeCount) + case "sparkStatus": + err = unpopulate(val, "SparkStatus", &p.SparkStatus) delete(rawMsg, key) - case "unusableNodeCount": - err = unpopulate(val, "UnusableNodeCount", &n.UnusableNodeCount) + case "subresourceTarget": + err = unpopulate(val, "SubresourceTarget", &p.SubresourceTarget) 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 PrivateEndpointOutboundRule. +func (p PrivateEndpointOutboundRule) 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) + 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 NoneAuthTypeWorkspaceConnectionProperties. -func (n *NoneAuthTypeWorkspaceConnectionProperties) 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", 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) + err = unpopulate(val, "Category", &p.Category) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &n.Target) + case "destination": + err = unpopulate(val, "Destination", &p.Destination) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &n.ValueFormat) + 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 NoneDatastoreCredentials. -func (n NoneDatastoreCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointResource. +func (p PrivateEndpointResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["credentialsType"] = CredentialsTypeNone + populate(objectMap, "id", p.ID) + populate(objectMap, "subnetArmId", p.SubnetArmID) 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 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "credentialsType": - err = unpopulate(val, "CredentialsType", &n.CredentialsType) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "subnetArmId": + err = unpopulate(val, "SubnetArmID", &p.SubnetArmID) 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 NotebookAccessTokenResult. -func (n NotebookAccessTokenResult) 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, "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", 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 NotebookAccessTokenResult. -func (n *NotebookAccessTokenResult) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "accessToken": - err = unpopulate(val, "AccessToken", &n.AccessToken) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "expiresIn": - err = unpopulate(val, "ExpiresIn", &n.ExpiresIn) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &n.HostName) + case "location": + err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) - case "notebookResourceId": - err = unpopulate(val, "NotebookResourceID", &n.NotebookResourceID) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "publicDns": - err = unpopulate(val, "PublicDNS", &n.PublicDNS) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "refreshToken": - err = unpopulate(val, "RefreshToken", &n.RefreshToken) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &n.Scope) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &n.TokenType) + 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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 PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorMessage", n.ErrorMessage) - populate(objectMap, "statusCode", n.StatusCode) + populate(objectMap, "value", p.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 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &n.ErrorMessage) - delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &n.StatusCode) + case "value": + err = unpopulate(val, "Value", &p.Value) 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 NotebookResourceInfo. -func (n NotebookResourceInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) 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, "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 NotebookResourceInfo. -func (n *NotebookResourceInfo) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &n.Fqdn) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "notebookPreparationError": - err = unpopulate(val, "NotebookPreparationError", &n.NotebookPreparationError) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &n.ResourceID) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) 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 Objective. -func (o Objective) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "goal", o.Goal) - populate(objectMap, "primaryMetric", o.PrimaryMetric) + 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 Objective. -func (o *Objective) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "goal": - err = unpopulate(val, "Goal", &o.Goal) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) - case "primaryMetric": - err = unpopulate(val, "PrimaryMetric", &o.PrimaryMetric) + 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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 ProbeSettings. +func (p ProbeSettings) 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) - return json.Marshal(objectMap) -} - -// 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", o, 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) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &o.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - o.Properties, err = unmarshalOnlineDeploymentPropertiesClassification(val) + 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 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &p.FailureThreshold) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &o.SKU) + case "initialDelay": + err = unpopulate(val, "InitialDelay", &p.InitialDelay) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &o.SystemData) + case "period": + err = unpopulate(val, "Period", &p.Period) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &o.Tags) + case "successThreshold": + err = unpopulate(val, "SuccessThreshold", &p.SuccessThreshold) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) + case "timeout": + err = unpopulate(val, "Timeout", &p.Timeout) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OnlineDeploymentProperties. -func (o OnlineDeploymentProperties) 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, "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) + 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 OnlineDeploymentProperties. -func (o *OnlineDeploymentProperties) 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", o, 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", &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) - delete(rawMsg, key) - case "modelMountPath": - err = unpopulate(val, "ModelMountPath", &o.ModelMountPath) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "readinessProbe": - err = unpopulate(val, "ReadinessProbe", &o.ReadinessProbe) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "requestSettings": - err = unpopulate(val, "RequestSettings", &o.RequestSettings) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) - case "scaleSettings": - o.ScaleSettings, err = unmarshalOnlineScaleSettingsClassification(val) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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 PyTorch. +func (p PyTorch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + objectMap["distributionType"] = DistributionTypePyTorch + populate(objectMap, "processCountPerInstance", p.ProcessCountPerInstance) 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 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", o, 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", &o.NextLink) + case "distributionType": + err = unpopulate(val, "DistributionType", &p.DistributionType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "processCountPerInstance": + err = unpopulate(val, "ProcessCountPerInstance", &p.ProcessCountPerInstance) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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 QueueSettings. +func (q QueueSettings) 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, "jobTier", q.JobTier) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, 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) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &o.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &o.SKU) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &o.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &o.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) + case "jobTier": + err = unpopulate(val, "JobTier", &q.JobTier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, 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 QuotaBaseProperties. +func (q QuotaBaseProperties) 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, "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 OnlineEndpointProperties. -func (o *OnlineEndpointProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, 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) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &o.PublicNetworkAccess) + case "id": + err = unpopulate(val, "ID", &q.ID) delete(rawMsg, key) - case "scoringUri": - err = unpopulate(val, "ScoringURI", &o.ScoringURI) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) delete(rawMsg, key) - case "swaggerUri": - err = unpopulate(val, "SwaggerURI", &o.SwaggerURI) + case "type": + err = unpopulate(val, "Type", &q.Type) delete(rawMsg, key) - case "traffic": - err = unpopulate(val, "Traffic", &o.Traffic) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, 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 QuotaUpdateParameters. +func (q QuotaUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "location", q.Location) + populate(objectMap, "value", q.Value) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "location": + err = unpopulate(val, "Location", &q.Location) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &o.Value) + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", q, 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 RandomSamplingAlgorithm. +func (r RandomSamplingAlgorithm) 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, "rule", r.Rule) + objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeRandom + populate(objectMap, "seed", r.Seed) 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 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", 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 "rule": + err = unpopulate(val, "Rule", &r.Rule) delete(rawMsg, key) - case "maxQueueWait": - err = unpopulate(val, "MaxQueueWait", &o.MaxQueueWait) + case "samplingAlgorithmType": + err = unpopulate(val, "SamplingAlgorithmType", &r.SamplingAlgorithmType) delete(rawMsg, key) - case "requestTimeout": - err = unpopulate(val, "RequestTimeout", &o.RequestTimeout) + case "seed": + err = unpopulate(val, "Seed", &r.Seed) 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 Recurrence. +func (r Recurrence) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["scaleType"] = o.ScaleType + 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 OnlineScaleSettings. -func (o *OnlineScaleSettings) 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 "scaleType": - err = unpopulate(val, "ScaleType", &o.ScaleType) + 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) 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 RecurrenceSchedule. +func (r RecurrenceSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "jobId", o.JobID) - populate(objectMap, "path", o.Path) - objectMap["referenceType"] = ReferenceTypeOutputPath + 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 OutputPathAssetReference. -func (o *OutputPathAssetReference) UnmarshalJSON(data []byte) error { +// 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", 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 "hours": + err = unpopulate(val, "Hours", &r.Hours) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &o.Path) + case "minutes": + err = unpopulate(val, "Minutes", &r.Minutes) delete(rawMsg, key) - case "referenceType": - err = unpopulate(val, "ReferenceType", &o.ReferenceType) + case "monthDays": + err = unpopulate(val, "MonthDays", &r.MonthDays) + delete(rawMsg, key) + 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 PATAuthTypeWorkspaceConnectionProperties. -func (p PATAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecurrenceTrigger. +func (r RecurrenceTrigger) 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, "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 PATAuthTypeWorkspaceConnectionProperties. -func (p *PATAuthTypeWorkspaceConnectionProperties) 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", 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) + case "endTime": + err = unpopulate(val, "EndTime", &r.EndTime) delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &p.Category) + case "frequency": + err = unpopulate(val, "Frequency", &r.Frequency) delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &p.Credentials) + case "interval": + err = unpopulate(val, "Interval", &r.Interval) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &p.Target) + case "schedule": + err = unpopulate(val, "Schedule", &r.Schedule) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "startTime": + err = unpopulate(val, "StartTime", &r.StartTime) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &p.ValueFormat) + case "timeZone": + err = unpopulate(val, "TimeZone", &r.TimeZone) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &r.TriggerType) 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 RegenerateEndpointKeysRequest. +func (r RegenerateEndpointKeysRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "keyType", r.KeyType) + populate(objectMap, "keyValue", r.KeyValue) 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 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", 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) + case "keyType": + err = unpopulate(val, "KeyType", &r.KeyType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "keyValue": + err = unpopulate(val, "KeyValue", &r.KeyValue) 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 Registry. +func (r Registry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) + 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 PartialBatchDeployment. -func (p *PartialBatchDeployment) 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", 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 "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &r.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + 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 PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. -func (p PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) 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, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) + 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 PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties. -func (p *PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties) 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", 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 "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "passwords": + err = unpopulate(val, "Passwords", &r.Passwords) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &r.Username) 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 RegistryPartialManagedServiceIdentity. +func (r RegistryPartialManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", p.Type) - populate(objectMap, "userAssignedIdentities", p.UserAssignedIdentities) + 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 PartialManagedServiceIdentity. -func (p *PartialManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// 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", p, err) + 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 "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &p.UserAssignedIdentities) + err = unpopulate(val, "UserAssignedIdentities", &r.UserAssignedIdentities) 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 RegistryPrivateEndpointConnection. +func (r RegistryPrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", p.Tags) + 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 PartialMinimalTrackedResource. -func (p *PartialMinimalTrackedResource) 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", 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 "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + 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", 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 RegistryPrivateEndpointConnectionProperties. +func (r RegistryPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", p.Identity) - populate(objectMap, "tags", p.Tags) + 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 PartialMinimalTrackedResourceWithIdentity. -func (p *PartialMinimalTrackedResourceWithIdentity) 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", 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) + case "groupIds": + err = unpopulate(val, "GroupIDs", &r.GroupIDs) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &r.PrivateEndpoint) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "registryPrivateLinkServiceConnectionState": + err = unpopulate(val, "RegistryPrivateLinkServiceConnectionState", &r.RegistryPrivateLinkServiceConnectionState) 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 RegistryPrivateLinkServiceConnectionState. +func (r RegistryPrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) + 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 PartialMinimalTrackedResourceWithSKU. -func (p *PartialMinimalTrackedResourceWithSKU) 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", 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) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &r.ActionsRequired) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + 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", 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 RegistryProperties. +func (r RegistryProperties) 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, "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 PartialSKU. -func (p *PartialSKU) 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", 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) + case "discoveryUrl": + err = unpopulate(val, "DiscoveryURL", &r.DiscoveryURL) delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &p.Family) + case "intellectualPropertyPublisher": + err = unpopulate(val, "IntellectualPropertyPublisher", &r.IntellectualPropertyPublisher) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "managedResourceGroup": + err = unpopulate(val, "ManagedResourceGroup", &r.ManagedResourceGroup) delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &p.Size) + case "mlFlowRegistryUri": + err = unpopulate(val, "MlFlowRegistryURI", &r.MlFlowRegistryURI) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &p.Tier) + 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", 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 RegistryRegionArmDetails. +func (r RegistryRegionArmDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "value", p.Value) + 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 Password. -func (p *Password) 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 "name": - err = unpopulate(val, "Name", &p.Name) + 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 "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 PersonalComputeInstanceSettings. -func (p PersonalComputeInstanceSettings) 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, "assignedUser", p.AssignedUser) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) 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 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 "assignedUser": - err = unpopulate(val, "AssignedUser", &p.AssignedUser) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + 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 PipelineJob. -func (p PipelineJob) 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, "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, "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) 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 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 "componentId": - err = unpopulate(val, "ComponentID", &p.ComponentID) + case "cvSplitColumnNames": + err = unpopulate(val, "CvSplitColumnNames", &r.CvSplitColumnNames) delete(rawMsg, key) - case "computeId": - err = unpopulate(val, "ComputeID", &p.ComputeID) + case "featurizationSettings": + err = unpopulate(val, "FeaturizationSettings", &r.FeaturizationSettings) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "limitSettings": + err = unpopulate(val, "LimitSettings", &r.LimitSettings) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &p.DisplayName) + case "logVerbosity": + err = unpopulate(val, "LogVerbosity", &r.LogVerbosity) delete(rawMsg, key) - case "experimentName": - err = unpopulate(val, "ExperimentName", &p.ExperimentName) + case "nCrossValidations": + r.NCrossValidations, err = unmarshalNCrossValidationsClassification(val) delete(rawMsg, key) - case "identity": - p.Identity, err = unmarshalIdentityConfigurationClassification(val) + case "primaryMetric": + err = unpopulate(val, "PrimaryMetric", &r.PrimaryMetric) delete(rawMsg, key) - case "inputs": - p.Inputs, err = unmarshalJobInputClassificationMap(val) + case "targetColumnName": + err = unpopulate(val, "TargetColumnName", &r.TargetColumnName) delete(rawMsg, key) - case "isArchived": - err = unpopulate(val, "IsArchived", &p.IsArchived) + case "taskType": + err = unpopulate(val, "TaskType", &r.TaskType) delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &p.JobType) + 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", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegressionTrainingSettings. +func (r RegressionTrainingSettings) 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) + return json.Marshal(objectMap) +} + +// 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedTrainingAlgorithms": + err = unpopulate(val, "AllowedTrainingAlgorithms", &r.AllowedTrainingAlgorithms) delete(rawMsg, key) - case "jobs": - err = unpopulate(val, "Jobs", &p.Jobs) + case "blockedTrainingAlgorithms": + err = unpopulate(val, "BlockedTrainingAlgorithms", &r.BlockedTrainingAlgorithms) delete(rawMsg, key) - case "outputs": - p.Outputs, err = unmarshalJobOutputClassificationMap(val) + case "enableDnnTraining": + err = unpopulate(val, "EnableDnnTraining", &r.EnableDnnTraining) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "enableModelExplainability": + err = unpopulate(val, "EnableModelExplainability", &r.EnableModelExplainability) delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &p.Services) + case "enableOnnxCompatibleModels": + err = unpopulate(val, "EnableOnnxCompatibleModels", &r.EnableOnnxCompatibleModels) delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &p.Settings) + case "enableStackEnsemble": + err = unpopulate(val, "EnableStackEnsemble", &r.EnableStackEnsemble) delete(rawMsg, key) - case "sourceJobId": - err = unpopulate(val, "SourceJobID", &p.SourceJobID) + case "enableVoteEnsemble": + err = unpopulate(val, "EnableVoteEnsemble", &r.EnableVoteEnsemble) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "ensembleModelDownloadTimeout": + err = unpopulate(val, "EnsembleModelDownloadTimeout", &r.EnsembleModelDownloadTimeout) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "stackEnsembleSettings": + err = unpopulate(val, "StackEnsembleSettings", &r.StackEnsembleSettings) 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 RequestLogging. +func (r RequestLogging) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "subnetArmId", p.SubnetArmID) + populate(objectMap, "captureHeaders", r.CaptureHeaders) 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 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 "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "subnetArmId": - err = unpopulate(val, "SubnetArmID", &p.SubnetArmID) + 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 PrivateEndpointConnection. -func (p PrivateEndpointConnection) 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, "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, "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 PrivateEndpointConnection. -func (p *PrivateEndpointConnection) 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 "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + err = unpopulate(val, "ID", &r.ID) 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) + err = unpopulate(val, "Name", &r.Name) 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, "SystemData", &r.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.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 PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) 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, "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 PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) 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 "value": - err = unpopulate(val, "Value", &p.Value) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + 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 PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) 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, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "instanceCount", r.InstanceCount) + populate(objectMap, "instanceType", r.InstanceType) + populate(objectMap, "properties", r.Properties) 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 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 "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &r.InstanceCount) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "instanceType": + err = unpopulate(val, "InstanceType", &r.InstanceType) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + 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 PrivateLinkResource. -func (p PrivateLinkResource) 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, "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, "id", r.ID) 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 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 "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &p.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - 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) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + 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 PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) 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, "value", p.Value) + populate(objectMap, "localizedValue", r.LocalizedValue) + populate(objectMap, "value", r.Value) 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 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 "localizedValue": + err = unpopulate(val, "LocalizedValue", &r.LocalizedValue) + 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 PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) 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, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + 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 PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) 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 "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) + case "amlWorkspaceLocation": + err = unpopulate(val, "AmlWorkspaceLocation", &r.AmlWorkspaceLocation) delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + 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) + 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 PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) 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, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + 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 PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) 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 "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + case "columns": + err = unpopulate(val, "Columns", &r.Columns) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "dataContext": + err = unpopulate(val, "DataContext", &r.DataContext) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + 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 ProbeSettings. -func (p ProbeSettings) 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, "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, "path", r.Path) + populate(objectMap, "port", r.Port) 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 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 "failureThreshold": - err = unpopulate(val, "FailureThreshold", &p.FailureThreshold) - delete(rawMsg, key) - case "initialDelay": - err = unpopulate(val, "InitialDelay", &p.InitialDelay) - delete(rawMsg, key) - case "period": - err = unpopulate(val, "Period", &p.Period) - delete(rawMsg, key) - case "successThreshold": - err = unpopulate(val, "SuccessThreshold", &p.SuccessThreshold) + case "path": + err = unpopulate(val, "Path", &r.Path) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &p.Timeout) + 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 PyTorch. -func (p PyTorch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SASAuthTypeWorkspaceConnectionProperties. +func (s SASAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["distributionType"] = DistributionTypePyTorch - populate(objectMap, "processCountPerInstance", p.ProcessCountPerInstance) + 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, "group", s.Group) + populate(objectMap, "isSharedToAll", s.IsSharedToAll) + populate(objectMap, "metadata", s.Metadata) + populate(objectMap, "sharedUserList", s.SharedUserList) + populate(objectMap, "target", s.Target) + populate(objectMap, "value", s.Value) + populate(objectMap, "valueFormat", s.ValueFormat) 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 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 "distributionType": - err = unpopulate(val, "DistributionType", &p.DistributionType) + case "authType": + err = unpopulate(val, "AuthType", &s.AuthType) delete(rawMsg, key) - case "processCountPerInstance": - err = unpopulate(val, "ProcessCountPerInstance", &p.ProcessCountPerInstance) + case "category": + err = unpopulate(val, "Category", &s.Category) + delete(rawMsg, key) + 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 "group": + err = unpopulate(val, "Group", &s.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &s.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &s.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &s.ValueFormat) 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 SASCredential. +func (s SASCredential) 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) + objectMap["credentialType"] = DataReferenceCredentialTypeSAS + populate(objectMap, "sasUri", s.SasURI) 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 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", 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 "credentialType": + err = unpopulate(val, "CredentialType", &s.CredentialType) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &q.Unit) + case "sasUri": + err = unpopulate(val, "SasURI", &s.SasURI) 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 SASCredentialDto. +func (s SASCredentialDto) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", q.Location) - populate(objectMap, "value", q.Value) + objectMap["credentialType"] = PendingUploadCredentialTypeSAS + populate(objectMap, "sasUri", s.SasURI) 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 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", 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 "credentialType": + err = unpopulate(val, "CredentialType", &s.CredentialType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) + case "sasUri": + err = unpopulate(val, "SasURI", &s.SasURI) 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 SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "rule", r.Rule) - objectMap["samplingAlgorithmType"] = SamplingAlgorithmTypeRandom - populate(objectMap, "seed", r.Seed) + 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 RandomSamplingAlgorithm. -func (r *RandomSamplingAlgorithm) 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", 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 "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) - case "samplingAlgorithmType": - err = unpopulate(val, "SamplingAlgorithmType", &r.SamplingAlgorithmType) + case "family": + err = unpopulate(val, "Family", &s.Family) delete(rawMsg, key) - case "seed": - err = unpopulate(val, "Seed", &r.Seed) + 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", 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 SKUCapacity. +func (s SKUCapacity) 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) + 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 RecurrenceSchedule. -func (r *RecurrenceSchedule) 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", 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) + case "default": + err = unpopulate(val, "Default", &s.Default) delete(rawMsg, key) - case "minutes": - err = unpopulate(val, "Minutes", &r.Minutes) + case "maximum": + err = unpopulate(val, "Maximum", &s.Maximum) delete(rawMsg, key) - case "monthDays": - err = unpopulate(val, "MonthDays", &r.MonthDays) + case "minimum": + err = unpopulate(val, "Minimum", &s.Minimum) delete(rawMsg, key) - case "weekDays": - err = unpopulate(val, "WeekDays", &r.WeekDays) + case "scaleType": + err = unpopulate(val, "ScaleType", &s.ScaleType) 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 SKUResource. +func (s SKUResource) 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 + 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 RecurrenceTrigger. -func (r *RecurrenceTrigger) 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", 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) + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &r.TimeZone) + case "resourceType": + err = unpopulate(val, "ResourceType", &s.ResourceType) delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &r.TriggerType) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) 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 SKUResourceArmPaginatedResult. +func (s SKUResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyType", r.KeyType) - populate(objectMap, "keyValue", r.KeyValue) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) 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 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", 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "keyValue": - err = unpopulate(val, "KeyValue", &r.KeyValue) + 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 RegistryListCredentialsResult. -func (r RegistryListCredentialsResult) 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", r.Location) - populate(objectMap, "passwords", r.Passwords) - populate(objectMap, "username", r.Username) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) 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 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", 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) - delete(rawMsg, key) - case "passwords": - err = unpopulate(val, "Passwords", &r.Passwords) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &r.Username) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) 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) { +// MarshalJSON implements the json.Marshaller interface for type SSLConfiguration. +func (s SSLConfiguration) 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) + 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 Regression. -func (r *Regression) 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 "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) + case "cert": + err = unpopulate(val, "Cert", &s.Cert) delete(rawMsg, key) - case "trainingData": - err = unpopulate(val, "TrainingData", &r.TrainingData) + case "cname": + err = unpopulate(val, "Cname", &s.Cname) delete(rawMsg, key) - case "trainingSettings": - err = unpopulate(val, "TrainingSettings", &r.TrainingSettings) + case "key": + err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &r.ValidationData) + case "leafDomainLabel": + err = unpopulate(val, "LeafDomainLabel", &s.LeafDomainLabel) delete(rawMsg, key) - case "validationDataSize": - err = unpopulate(val, "ValidationDataSize", &r.ValidationDataSize) + case "overwriteExistingDomain": + err = unpopulate(val, "OverwriteExistingDomain", &s.OverwriteExistingDomain) delete(rawMsg, key) - case "weightColumnName": - err = unpopulate(val, "WeightColumnName", &r.WeightColumnName) + 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 RegressionTrainingSettings. -func (r RegressionTrainingSettings) 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, "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) + objectMap["samplingAlgorithmType"] = s.SamplingAlgorithmType 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 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 "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) - 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) + 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 Resource. -func (r Resource) 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, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) + objectMap["credentialsType"] = CredentialsTypeSas + populate(objectMap, "secrets", s.Secrets) 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 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 "id": - err = unpopulate(val, "ID", &r.ID) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &s.CredentialsType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "secrets": + err = unpopulate(val, "Secrets", &s.Secrets) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SasDatastoreSecrets. +func (s SasDatastoreSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasToken", s.SasToken) + objectMap["secretsType"] = SecretsTypeSas + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sasToken": + err = unpopulate(val, "SasToken", &s.SasToken) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + 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 ResourceBase. -func (r ResourceBase) 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, "description", r.Description) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) + 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 ResourceBase. -func (r *ResourceBase) 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 "description": - err = unpopulate(val, "Description", &r.Description) + case "maxNodeCount": + err = unpopulate(val, "MaxNodeCount", &s.MaxNodeCount) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "minNodeCount": + err = unpopulate(val, "MinNodeCount", &s.MinNodeCount) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + 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 ResourceConfiguration. -func (r ResourceConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScaleSettingsInformation. +func (s ScaleSettingsInformation) 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, "scaleSettings", s.ScaleSettings) 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 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 "instanceCount": - err = unpopulate(val, "InstanceCount", &r.InstanceCount) - delete(rawMsg, key) - case "instanceType": - err = unpopulate(val, "InstanceType", &r.InstanceType) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + 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 ResourceID. -func (r ResourceID) 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, "id", r.ID) + 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 ResourceID. -func (r *ResourceID) 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 "id": - err = unpopulate(val, "ID", &r.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) + delete(rawMsg, key) + 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 ResourceName. -func (r ResourceName) 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, "localizedValue", r.LocalizedValue) - populate(objectMap, "value", r.Value) + objectMap["actionType"] = s.ActionType 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 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 "localizedValue": - err = unpopulate(val, "LocalizedValue", &r.LocalizedValue) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + 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 ResourceQuota. -func (r ResourceQuota) 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, "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, "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 ResourceQuota. -func (r *ResourceQuota) 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 "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) + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "provisioningStatus": + err = unpopulate(val, "ProvisioningStatus", &s.ProvisioningStatus) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) + 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 Route. -func (r Route) 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, "path", r.Path) - populate(objectMap, "port", r.Port) + 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 Route. -func (r *Route) 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 "path": - err = unpopulate(val, "Path", &r.Path) + case "action": + s.Action, err = unmarshalScheduleActionBaseClassification(val) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &r.Port) + 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) 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 ScheduleResourceArmPaginatedResult. +func (s ScheduleResourceArmPaginatedResult) 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, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) - populate(objectMap, "valueFormat", s.ValueFormat) 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 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", s, err) @@ -12279,24 +18235,12 @@ 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) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) - case "valueFormat": - err = unpopulate(val, "ValueFormat", &s.ValueFormat) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -12305,19 +18249,18 @@ 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 ScriptReference. +func (s ScriptReference) 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, "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 SKU. -func (s *SKU) 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", s, err) @@ -12325,20 +18268,17 @@ 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 "scriptArguments": + err = unpopulate(val, "ScriptArguments", &s.ScriptArguments) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "scriptData": + err = unpopulate(val, "ScriptData", &s.ScriptData) delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &s.Size) + case "scriptSource": + err = unpopulate(val, "ScriptSource", &s.ScriptSource) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) + case "timeout": + err = unpopulate(val, "Timeout", &s.Timeout) delete(rawMsg, key) } if err != nil { @@ -12348,18 +18288,16 @@ 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 ScriptsToExecute. +func (s ScriptsToExecute) 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, "creationScript", s.CreationScript) + populate(objectMap, "startupScript", s.StartupScript) 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 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", s, err) @@ -12367,17 +18305,11 @@ 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) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &s.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &s.Minimum) + case "creationScript": + err = unpopulate(val, "CreationScript", &s.CreationScript) delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &s.ScaleType) + case "startupScript": + err = unpopulate(val, "StartupScript", &s.StartupScript) delete(rawMsg, key) } if err != nil { @@ -12387,17 +18319,15 @@ 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 Seasonality. +func (s Seasonality) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "resourceType", s.ResourceType) - populate(objectMap, "sku", s.SKU) + objectMap["mode"] = s.Mode 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 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", s, err) @@ -12405,14 +18335,8 @@ 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) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &s.ResourceType) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) + case "mode": + err = unpopulate(val, "Mode", &s.Mode) delete(rawMsg, key) } if err != nil { @@ -12422,16 +18346,16 @@ 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 SecretExpiry. +func (s SecretExpiry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "expirableSecret", s.ExpirableSecret) + populate(objectMap, "expireAfterHours", s.ExpireAfterHours) 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 SecretExpiry. +func (s *SecretExpiry) UnmarshalJSON(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) @@ -12439,11 +18363,11 @@ 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 "expirableSecret": + err = unpopulate(val, "ExpirableSecret", &s.ExpirableSecret) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "expireAfterHours": + err = unpopulate(val, "ExpireAfterHours", &s.ExpireAfterHours) delete(rawMsg, key) } if err != nil { @@ -12453,16 +18377,16 @@ 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 ServerlessComputeSettings. +func (s ServerlessComputeSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - 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 SKUSetting. -func (s *SKUSetting) 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) @@ -12470,11 +18394,11 @@ 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) + case "serverlessComputeCustomSubnet": + err = unpopulate(val, "ServerlessComputeCustomSubnet", &s.ServerlessComputeCustomSubnet) 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 { @@ -12484,20 +18408,24 @@ 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 ServerlessEndpoint. +func (s ServerlessEndpoint) 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, "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 SSLConfiguration. -func (s *SSLConfiguration) 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) @@ -12505,23 +18433,35 @@ 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) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "cname": - err = unpopulate(val, "Cname", &s.Cname) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) - case "key": - err = unpopulate(val, "Key", &s.Key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) delete(rawMsg, key) - case "leafDomainLabel": - err = unpopulate(val, "LeafDomainLabel", &s.LeafDomainLabel) + case "location": + err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) - case "overwriteExistingDomain": - err = unpopulate(val, "OverwriteExistingDomain", &s.OverwriteExistingDomain) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + 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 { @@ -12531,15 +18471,21 @@ 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 ServerlessEndpointProperties. +func (s ServerlessEndpointProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["samplingAlgorithmType"] = s.SamplingAlgorithmType + populate(objectMap, "authMode", s.AuthMode) + populate(objectMap, "contentSafety", s.ContentSafety) + populate(objectMap, "endpointState", s.EndpointState) + populate(objectMap, "inferenceEndpoint", s.InferenceEndpoint) + populate(objectMap, "marketplaceSubscriptionId", s.MarketplaceSubscriptionID) + populate(objectMap, "modelSettings", s.ModelSettings) + populate(objectMap, "provisioningState", s.ProvisioningState) 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 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) @@ -12547,8 +18493,26 @@ 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 "authMode": + err = unpopulate(val, "AuthMode", &s.AuthMode) + delete(rawMsg, key) + case "contentSafety": + err = unpopulate(val, "ContentSafety", &s.ContentSafety) + delete(rawMsg, key) + case "endpointState": + err = unpopulate(val, "EndpointState", &s.EndpointState) + delete(rawMsg, key) + case "inferenceEndpoint": + err = unpopulate(val, "InferenceEndpoint", &s.InferenceEndpoint) + delete(rawMsg, key) + case "marketplaceSubscriptionId": + err = unpopulate(val, "MarketplaceSubscriptionID", &s.MarketplaceSubscriptionID) + delete(rawMsg, key) + case "modelSettings": + err = unpopulate(val, "ModelSettings", &s.ModelSettings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -12558,16 +18522,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 ServerlessEndpointTrackedResourceArmPaginatedResult. +func (s ServerlessEndpointTrackedResourceArmPaginatedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["credentialsType"] = CredentialsTypeSas - populate(objectMap, "secrets", s.Secrets) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) 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 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) @@ -12575,11 +18539,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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -12589,16 +18553,16 @@ 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 ServerlessInferenceEndpoint. +func (s ServerlessInferenceEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sasToken", s.SasToken) - objectMap["secretsType"] = SecretsTypeSas + populate(objectMap, "headers", s.Headers) + populate(objectMap, "uri", s.URI) 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 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) @@ -12606,11 +18570,11 @@ 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) + case "headers": + err = unpopulate(val, "Headers", &s.Headers) delete(rawMsg, key) - case "secretsType": - err = unpopulate(val, "SecretsType", &s.SecretsType) + case "uri": + err = unpopulate(val, "URI", &s.URI) delete(rawMsg, key) } if err != nil { @@ -12620,17 +18584,15 @@ 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 ServiceManagedResourcesSettings. +func (s ServiceManagedResourcesSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxNodeCount", s.MaxNodeCount) - populate(objectMap, "minNodeCount", s.MinNodeCount) - populate(objectMap, "nodeIdleTimeBeforeScaleDown", s.NodeIdleTimeBeforeScaleDown) + populate(objectMap, "cosmosDb", s.CosmosDb) 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 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) @@ -12638,14 +18600,8 @@ 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) - delete(rawMsg, key) - case "minNodeCount": - err = unpopulate(val, "MinNodeCount", &s.MinNodeCount) - delete(rawMsg, key) - case "nodeIdleTimeBeforeScaleDown": - err = unpopulate(val, "NodeIdleTimeBeforeScaleDown", &s.NodeIdleTimeBeforeScaleDown) + case "cosmosDb": + err = unpopulate(val, "CosmosDb", &s.CosmosDb) delete(rawMsg, key) } if err != nil { @@ -12655,15 +18611,26 @@ 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 ServicePrincipalAuthTypeWorkspaceConnectionProperties. +func (s ServicePrincipalAuthTypeWorkspaceConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "scaleSettings", s.ScaleSettings) + 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, "group", s.Group) + populate(objectMap, "isSharedToAll", s.IsSharedToAll) + populate(objectMap, "metadata", s.Metadata) + populate(objectMap, "sharedUserList", s.SharedUserList) + populate(objectMap, "target", s.Target) + populate(objectMap, "value", s.Value) + populate(objectMap, "valueFormat", s.ValueFormat) 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 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) @@ -12671,8 +18638,41 @@ 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 "authType": + err = unpopulate(val, "AuthType", &s.AuthType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &s.Category) + delete(rawMsg, key) + 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 "group": + err = unpopulate(val, "Group", &s.Group) + 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 "sharedUserList": + err = unpopulate(val, "SharedUserList", &s.SharedUserList) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &s.Target) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + case "valueFormat": + err = unpopulate(val, "ValueFormat", &s.ValueFormat) delete(rawMsg, key) } if err != nil { @@ -12682,19 +18682,20 @@ func (s *ScaleSettingsInformation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Schedule. -func (s Schedule) 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) +// MarshalJSON implements the json.Marshaller interface for type ServicePrincipalDatastoreCredentials. +func (s ServicePrincipalDatastoreCredentials) 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) 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 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) @@ -12702,20 +18703,23 @@ 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) + case "authorityUrl": + err = unpopulate(val, "AuthorityURL", &s.AuthorityURL) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "credentialsType": + err = unpopulate(val, "CredentialsType", &s.CredentialsType) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "resourceUrl": + err = unpopulate(val, "ResourceURL", &s.ResourceURL) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + 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 { @@ -12725,15 +18729,16 @@ 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 ServicePrincipalDatastoreSecrets. +func (s ServicePrincipalDatastoreSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["actionType"] = s.ActionType + populate(objectMap, "clientSecret", s.ClientSecret) + objectMap["secretsType"] = SecretsTypeServicePrincipal 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 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) @@ -12741,8 +18746,11 @@ 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 "clientSecret": + err = unpopulate(val, "ClientSecret", &s.ClientSecret) + delete(rawMsg, key) + case "secretsType": + err = unpopulate(val, "SecretsType", &s.SecretsType) delete(rawMsg, key) } if err != nil { @@ -12752,17 +18760,19 @@ 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 ServiceTagDestination. +func (s ServiceTagDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "provisioningStatus", s.ProvisioningStatus) - populate(objectMap, "status", s.Status) + 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 ScheduleBase. -func (s *ScheduleBase) 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) @@ -12770,14 +18780,20 @@ 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 "action": + err = unpopulate(val, "Action", &s.Action) delete(rawMsg, key) - case "provisioningStatus": - err = unpopulate(val, "ProvisioningStatus", &s.ProvisioningStatus) + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &s.AddressPrefixes) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + 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 { @@ -12787,22 +18803,18 @@ 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 ServiceTagOutboundRule. +func (s ServiceTagOutboundRule) 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, "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 ScheduleProperties. -func (s *ScheduleProperties) 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) @@ -12810,29 +18822,17 @@ 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) + case "category": + err = unpopulate(val, "Category", &s.Category) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + case "destination": + err = unpopulate(val, "Destination", &s.Destination) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) - case "trigger": - s.Trigger, err = unmarshalTriggerBaseClassification(val) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -12842,16 +18842,15 @@ 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 SetupScripts. +func (s SetupScripts) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "scripts", s.Scripts) 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 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) @@ -12859,11 +18858,8 @@ 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) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "scripts": + err = unpopulate(val, "Scripts", &s.Scripts) delete(rawMsg, key) } if err != nil { @@ -12873,18 +18869,16 @@ 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 SharedPrivateLinkResource. +func (s SharedPrivateLinkResource) 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, "name", s.Name) + populate(objectMap, "properties", s.Properties) 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 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) @@ -12892,17 +18886,11 @@ 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) - delete(rawMsg, key) - case "scriptData": - err = unpopulate(val, "ScriptData", &s.ScriptData) - delete(rawMsg, key) - case "scriptSource": - err = unpopulate(val, "ScriptSource", &s.ScriptSource) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &s.Timeout) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { @@ -12912,16 +18900,18 @@ 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 SharedPrivateLinkResourceProperty. +func (s SharedPrivateLinkResourceProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "creationScript", s.CreationScript) - populate(objectMap, "startupScript", s.StartupScript) + 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 ScriptsToExecute. -func (s *ScriptsToExecute) 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) @@ -12929,11 +18919,17 @@ 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 "groupId": + err = unpopulate(val, "GroupID", &s.GroupID) delete(rawMsg, key) - case "startupScript": - err = unpopulate(val, "StartupScript", &s.StartupScript) + case "privateLinkResourceId": + err = unpopulate(val, "PrivateLinkResourceID", &s.PrivateLinkResourceID) + delete(rawMsg, key) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &s.RequestMessage) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { @@ -12943,15 +18939,41 @@ 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 SparkJob. +func (s SparkJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["mode"] = s.Mode + 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, "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 Seasonality. -func (s *Seasonality) 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) @@ -12959,8 +18981,86 @@ 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 "archives": + err = unpopulate(val, "Archives", &s.Archives) + delete(rawMsg, key) + 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 "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 { @@ -12970,15 +19070,15 @@ 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 SparkJobEntry. +func (s SparkJobEntry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cosmosDb", s.CosmosDb) + objectMap["sparkJobEntryType"] = s.SparkJobEntryType 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 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) @@ -12986,8 +19086,8 @@ 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 "sparkJobEntryType": + err = unpopulate(val, "SparkJobEntryType", &s.SparkJobEntryType) delete(rawMsg, key) } if err != nil { @@ -12997,20 +19097,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 SparkJobPythonEntry. +func (s SparkJobPythonEntry) 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, "file", s.File) + objectMap["sparkJobEntryType"] = SparkJobEntryTypeSparkJobPythonEntry 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 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) @@ -13018,23 +19114,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 "file": + err = unpopulate(val, "File", &s.File) 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 { @@ -13044,16 +19128,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 SparkJobScalaEntry. +func (s SparkJobScalaEntry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientSecret", s.ClientSecret) - objectMap["secretsType"] = SecretsTypeServicePrincipal + populate(objectMap, "className", s.ClassName) + objectMap["sparkJobEntryType"] = SparkJobEntryTypeSparkJobScalaEntry 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 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) @@ -13061,11 +19145,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 "className": + err = unpopulate(val, "ClassName", &s.ClassName) delete(rawMsg, key) - case "secretsType": - err = unpopulate(val, "SecretsType", &s.SecretsType) + case "sparkJobEntryType": + err = unpopulate(val, "SparkJobEntryType", &s.SparkJobEntryType) delete(rawMsg, key) } if err != nil { @@ -13075,15 +19159,16 @@ 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 SparkResourceConfiguration. +func (s SparkResourceConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "scripts", s.Scripts) + populate(objectMap, "instanceType", s.InstanceType) + populate(objectMap, "runtimeVersion", s.RuntimeVersion) 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 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) @@ -13091,8 +19176,11 @@ 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 "instanceType": + err = unpopulate(val, "InstanceType", &s.InstanceType) + delete(rawMsg, key) + case "runtimeVersion": + err = unpopulate(val, "RuntimeVersion", &s.RuntimeVersion) delete(rawMsg, key) } if err != nil { @@ -13102,16 +19190,17 @@ 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 StackEnsembleSettings. +func (s StackEnsembleSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) + 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 SharedPrivateLinkResource. -func (s *SharedPrivateLinkResource) 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) @@ -13119,11 +19208,14 @@ 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 "stackMetaLearnerKWargs": + err = unpopulate(val, "StackMetaLearnerKWargs", &s.StackMetaLearnerKWargs) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + 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 { @@ -13133,18 +19225,22 @@ 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 StaticInputData. +func (s StaticInputData) 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, "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 SharedPrivateLinkResourceProperty. -func (s *SharedPrivateLinkResourceProperty) 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) @@ -13152,17 +19248,29 @@ 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 "columns": + err = unpopulate(val, "Columns", &s.Columns) delete(rawMsg, key) - case "privateLinkResourceId": - err = unpopulate(val, "PrivateLinkResourceID", &s.PrivateLinkResourceID) + case "dataContext": + err = unpopulate(val, "DataContext", &s.DataContext) delete(rawMsg, key) - case "requestMessage": - err = unpopulate(val, "RequestMessage", &s.RequestMessage) + case "inputDataType": + err = unpopulate(val, "InputDataType", &s.InputDataType) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + 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 { @@ -13172,17 +19280,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) @@ -13190,14 +19297,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 { @@ -13221,9 +19325,11 @@ 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, "samplingAlgorithm", s.SamplingAlgorithm) populateAny(objectMap, "searchSpace", s.SearchSpace) populate(objectMap, "services", s.Services) @@ -13275,6 +19381,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) @@ -13284,6 +19393,9 @@ 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 "samplingAlgorithm": s.SamplingAlgorithm, err = unmarshalSamplingAlgorithmClassification(val) delete(rawMsg, key) @@ -13483,6 +19595,84 @@ func (s *SynapseSparkProperties) UnmarshalJSON(data []byte) error { 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 "storageAccountHnsEnabled": + err = unpopulate(val, "StorageAccountHnsEnabled", &s.StorageAccountHnsEnabled) + delete(rawMsg, key) + 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 { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14019,6 +20209,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) @@ -14800,6 +21048,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) @@ -14832,7 +21134,13 @@ 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, "group", u.Group) + populate(objectMap, "isSharedToAll", u.IsSharedToAll) + populate(objectMap, "metadata", u.Metadata) + populate(objectMap, "sharedUserList", u.SharedUserList) populate(objectMap, "target", u.Target) populate(objectMap, "value", u.Value) populate(objectMap, "valueFormat", u.ValueFormat) @@ -14854,8 +21162,26 @@ func (u *UsernamePasswordAuthTypeWorkspaceConnectionProperties) UnmarshalJSON(da case "category": err = unpopulate(val, "Category", &u.Category) delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &u.Credentials) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &u.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "credentials": + err = unpopulate(val, "Credentials", &u.Credentials) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &u.ExpiryTime) + delete(rawMsg, key) + case "group": + err = unpopulate(val, "Group", &u.Group) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &u.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &u.Metadata) + delete(rawMsg, key) + case "sharedUserList": + err = unpopulate(val, "SharedUserList", &u.SharedUserList) delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &u.Target) @@ -15233,11 +21559,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) @@ -15263,6 +21703,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) @@ -15292,6 +21735,91 @@ 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 WorkspaceConnectionAccountKey. +func (w WorkspaceConnectionAccountKey) 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 WorkspaceConnectionAccountKey. +func (w *WorkspaceConnectionAccountKey) UnmarshalJSON(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 WorkspaceConnectionManagedIdentity. func (w WorkspaceConnectionManagedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15323,6 +21851,61 @@ func (w *WorkspaceConnectionManagedIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceConnectionOAuth2. +func (w WorkspaceConnectionOAuth2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authUrl", w.AuthURL) + populate(objectMap, "clientId", w.ClientID) + populate(objectMap, "clientSecret", w.ClientSecret) + populate(objectMap, "developerToken", w.DeveloperToken) + populate(objectMap, "password", w.Password) + populate(objectMap, "refreshToken", w.RefreshToken) + populate(objectMap, "tenantId", w.TenantID) + populate(objectMap, "username", w.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceConnectionOAuth2. +func (w *WorkspaceConnectionOAuth2) UnmarshalJSON(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 "authUrl": + err = unpopulate(val, "AuthURL", &w.AuthURL) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &w.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &w.ClientSecret) + delete(rawMsg, key) + case "developerToken": + err = unpopulate(val, "DeveloperToken", &w.DeveloperToken) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &w.Password) + delete(rawMsg, key) + case "refreshToken": + err = unpopulate(val, "RefreshToken", &w.RefreshToken) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &w.TenantID) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &w.Username) + 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 WorkspaceConnectionPersonalAccessToken. func (w WorkspaceConnectionPersonalAccessToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15355,6 +21938,12 @@ 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, "group", w.Group) + populate(objectMap, "isSharedToAll", w.IsSharedToAll) + populate(objectMap, "metadata", w.Metadata) + populate(objectMap, "sharedUserList", w.SharedUserList) populate(objectMap, "target", w.Target) populate(objectMap, "value", w.Value) populate(objectMap, "valueFormat", w.ValueFormat) @@ -15376,6 +21965,24 @@ func (w *WorkspaceConnectionPropertiesV2) UnmarshalJSON(data []byte) error { case "category": err = unpopulate(val, "Category", &w.Category) delete(rawMsg, key) + case "createdByWorkspaceArmId": + err = unpopulate(val, "CreatedByWorkspaceArmID", &w.CreatedByWorkspaceArmID) + delete(rawMsg, key) + case "expiryTime": + err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &w.ExpiryTime) + delete(rawMsg, key) + case "group": + err = unpopulate(val, "Group", &w.Group) + delete(rawMsg, key) + case "isSharedToAll": + err = unpopulate(val, "IsSharedToAll", &w.IsSharedToAll) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &w.Metadata) + delete(rawMsg, key) + case "sharedUserList": + err = unpopulate(val, "SharedUserList", &w.SharedUserList) + delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &w.Target) delete(rawMsg, key) @@ -15467,6 +22074,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) @@ -15498,6 +22140,7 @@ func (w *WorkspaceConnectionSharedAccessSignature) UnmarshalJSON(data []byte) er func (w WorkspaceConnectionUsernamePassword) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "password", w.Password) + populate(objectMap, "securityToken", w.SecurityToken) populate(objectMap, "username", w.Username) return json.Marshal(objectMap) } @@ -15514,6 +22157,9 @@ func (w *WorkspaceConnectionUsernamePassword) UnmarshalJSON(data []byte) error { case "password": err = unpopulate(val, "Password", &w.Password) delete(rawMsg, key) + case "securityToken": + err = unpopulate(val, "SecurityToken", &w.SecurityToken) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &w.Username) delete(rawMsg, key) @@ -15525,6 +22171,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) @@ -15561,14 +22238,19 @@ 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, "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, "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, "managedNetwork", w.ManagedNetwork) populate(objectMap, "mlFlowTrackingUri", w.MlFlowTrackingURI) populate(objectMap, "notebookInfo", w.NotebookInfo) populate(objectMap, "primaryUserAssignedIdentity", w.PrimaryUserAssignedIdentity) @@ -15576,6 +22258,7 @@ 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) @@ -15583,6 +22266,7 @@ func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "storageHnsEnabled", w.StorageHnsEnabled) populate(objectMap, "tenantId", w.TenantID) populate(objectMap, "v1LegacyMode", w.V1LegacyMode) + populate(objectMap, "workspaceHubConfig", w.WorkspaceHubConfig) populate(objectMap, "workspaceId", w.WorkspaceID) return json.Marshal(objectMap) } @@ -15602,6 +22286,9 @@ 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 "containerRegistry": err = unpopulate(val, "ContainerRegistry", &w.ContainerRegistry) delete(rawMsg, key) @@ -15611,21 +22298,33 @@ 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 "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 "managedNetwork": + err = unpopulate(val, "ManagedNetwork", &w.ManagedNetwork) + delete(rawMsg, key) case "mlFlowTrackingUri": err = unpopulate(val, "MlFlowTrackingURI", &w.MlFlowTrackingURI) delete(rawMsg, key) @@ -15647,6 +22346,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) @@ -15668,6 +22370,9 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { 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) @@ -15685,11 +22390,17 @@ 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, "v1LegacyMode", w.V1LegacyMode) return json.Marshal(objectMap) } @@ -15711,21 +22422,39 @@ 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 "v1LegacyMode": + err = unpopulate(val, "V1LegacyMode", &w.V1LegacyMode) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) @@ -15794,7 +22523,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go index 9dac0a522c3f..3588eab4bd60 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/modelversions_client.go @@ -47,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-07-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. @@ -105,7 +105,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -126,7 +126,7 @@ 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-07-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. @@ -181,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ 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-07-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. @@ -246,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,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-07-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. @@ -315,36 +315,36 @@ func (client *ModelVersionsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") - 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.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } 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) - } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.Description != nil { reqQP.Set("description", *options.Description) } + if options != nil && options.Feed != nil { + reqQP.Set("feed", *options.Feed) + } + if options != nil && options.ListViewType != nil { + reqQP.Set("listViewType", string(*options.ListViewType)) + } if options != nil && options.Offset != nil { reqQP.Set("offset", strconv.FormatInt(int64(*options.Offset), 10)) } - 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.Feed != nil { - reqQP.Set("feed", *options.Feed) + 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.Version != nil { + reqQP.Set("version", *options.Version) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -359,3 +359,94 @@ func (client *ModelVersionsClient) listHandleResponse(resp *http.Response) (Mode } return result, nil } + +// BeginPublish - Publish version asset into registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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-07-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.StatusOK, 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-07-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 771950bbee0d..86642573665e 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/onlinedeployments_client.go @@ -47,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-07-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,7 +62,8 @@ func (client *OnlineDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineDeploymentsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -75,7 +76,7 @@ func (client *OnlineDeploymentsClient) BeginCreateOrUpdate(ctx context.Context, // 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-07-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" @@ -125,7 +126,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -137,7 +138,7 @@ func (client *OnlineDeploymentsClient) createOrUpdateCreateRequest(ctx context.C // 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-07-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. @@ -151,7 +152,8 @@ func (client *OnlineDeploymentsClient) BeginDelete(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineDeploymentsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -164,7 +166,7 @@ func (client *OnlineDeploymentsClient) BeginDelete(ctx context.Context, resource // 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-07-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" @@ -214,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,7 +225,7 @@ 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-07-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. @@ -279,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,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-07-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. @@ -355,7 +357,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -375,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-07-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. @@ -428,16 +430,16 @@ func (client *OnlineDeploymentsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") 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.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2024-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,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-07-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. @@ -512,13 +514,13 @@ func (client *OnlineDeploymentsClient) listSKUsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") - 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) } + reqQP.Set("api-version", "2024-07-01-preview") + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -536,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-07-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. @@ -564,7 +566,7 @@ func (client *OnlineDeploymentsClient) BeginUpdate(ctx context.Context, resource // 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-07-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" @@ -614,7 +616,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 51f9519ef160..e87191e441ce 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/onlineendpoints_client.go @@ -47,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-07-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,7 +61,8 @@ func (client *OnlineEndpointsClient) BeginCreateOrUpdate(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -74,7 +75,7 @@ func (client *OnlineEndpointsClient) BeginCreateOrUpdate(ctx context.Context, re // 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-07-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" @@ -120,7 +121,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -132,7 +133,7 @@ func (client *OnlineEndpointsClient) createOrUpdateCreateRequest(ctx context.Con // 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-07-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. @@ -145,7 +146,8 @@ func (client *OnlineEndpointsClient) BeginDelete(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OnlineEndpointsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -158,7 +160,7 @@ func (client *OnlineEndpointsClient) BeginDelete(ctx context.Context, resourceGr // 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-07-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" @@ -204,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +215,7 @@ 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-07-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. @@ -264,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,10 +281,10 @@ 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-07-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. @@ -334,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,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-07-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 @@ -399,27 +401,27 @@ func (client *OnlineEndpointsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") - if options != nil && options.Name != nil { - reqQP.Set("name", *options.Name) - } - 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) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ComputeType != nil { reqQP.Set("computeType", string(*options.ComputeType)) } - if options != nil && options.Skip != nil { - reqQP.Set("$skip", *options.Skip) + if options != nil && options.Count != nil { + reqQP.Set("count", strconv.FormatInt(int64(*options.Count), 10)) } - if options != nil && options.Tags != nil { - reqQP.Set("tags", *options.Tags) + if options != nil && options.Name != nil { + reqQP.Set("name", *options.Name) + } + if options != nil && options.OrderBy != nil { + reqQP.Set("orderBy", string(*options.OrderBy)) } if options != nil && options.Properties != nil { reqQP.Set("properties", *options.Properties) } - if options != nil && options.OrderBy != nil { - reqQP.Set("orderBy", string(*options.OrderBy)) + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -438,7 +440,7 @@ 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-07-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. @@ -490,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -508,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-07-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. @@ -536,7 +538,7 @@ func (client *OnlineEndpointsClient) BeginRegenerateKeys(ctx context.Context, re // 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-07-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" @@ -582,7 +584,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -594,7 +596,7 @@ func (client *OnlineEndpointsClient) regenerateKeysCreateRequest(ctx context.Con // 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-07-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. @@ -621,7 +623,7 @@ func (client *OnlineEndpointsClient) BeginUpdate(ctx context.Context, resourceGr // 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-07-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" @@ -667,7 +669,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 6c71bd6f4325..78d86adf30f3 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // 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-07-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]{ @@ -73,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -82,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 index 93d7cdecfce3..97a042f7a7cc 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/options.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/options.go @@ -104,6 +104,18 @@ type CodeContainersClientListOptions struct { 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 @@ -121,6 +133,12 @@ type CodeVersionsClientGetOptions struct { // 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 @@ -156,6 +174,13 @@ type ComponentContainersClientListOptions struct { 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 { @@ -269,6 +294,12 @@ type DataContainersClientListOptions struct { 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 @@ -346,7 +377,8 @@ type DatastoresClientListOptions struct { // DatastoresClientListSecretsOptions contains the optional parameters for the DatastoresClient.ListSecrets method. type DatastoresClientListSecretsOptions struct { - // placeholder for future optional parameters + // Secret expiry information. + Body *SecretExpiry } // EnvironmentContainersClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentContainersClient.CreateOrUpdate @@ -375,6 +407,13 @@ type EnvironmentContainersClientListOptions struct { 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 { @@ -406,6 +445,234 @@ type EnvironmentVersionsClientListOptions struct { 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 +} + // JobsClientBeginCancelOptions contains the optional parameters for the JobsClient.BeginCancel method. type JobsClientBeginCancelOptions struct { // Resumes the LRO from the provided token. @@ -436,6 +703,9 @@ type JobsClientListOptions struct { // View type for including/excluding (for example) archived entities. ListViewType *ListViewType + // Comma-separated list of user property names (and optionally values). Example: prop1,prop2=value2 + Properties *string + // Continuation token for pagination. Skip *string @@ -443,6 +713,68 @@ type JobsClientListOptions struct { Tag *string } +// 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 +} + +// MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the MarketplaceSubscriptionsClient.BeginCreateOrUpdate +// method. +type MarketplaceSubscriptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MarketplaceSubscriptionsClientBeginDeleteOptions contains the optional parameters for the MarketplaceSubscriptionsClient.BeginDelete +// method. +type MarketplaceSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MarketplaceSubscriptionsClientGetOptions contains the optional parameters for the MarketplaceSubscriptionsClient.Get method. +type MarketplaceSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MarketplaceSubscriptionsClientListOptions contains the optional parameters for the MarketplaceSubscriptionsClient.NewListPager +// method. +type MarketplaceSubscriptionsClientListOptions struct { + // Continuation token for pagination. + Skip *string +} + // ModelContainersClientCreateOrUpdateOptions contains the optional parameters for the ModelContainersClient.CreateOrUpdate // method. type ModelContainersClientCreateOrUpdateOptions struct { @@ -471,6 +803,12 @@ type ModelContainersClientListOptions struct { Skip *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 @@ -683,55 +1021,493 @@ type QuotasClientUpdateOptions struct { // placeholder for future optional parameters } -// SchedulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SchedulesClient.BeginCreateOrUpdate +// RegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the RegistriesClient.BeginCreateOrUpdate // method. -type SchedulesClientBeginCreateOrUpdateOptions struct { +type RegistriesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// SchedulesClientBeginDeleteOptions contains the optional parameters for the SchedulesClient.BeginDelete method. -type SchedulesClientBeginDeleteOptions struct { +// RegistriesClientBeginDeleteOptions contains the optional parameters for the RegistriesClient.BeginDelete method. +type RegistriesClientBeginDeleteOptions 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 +// RegistriesClientBeginRemoveRegionsOptions contains the optional parameters for the RegistriesClient.BeginRemoveRegions +// method. +type RegistriesClientBeginRemoveRegionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. -type UsagesClientListOptions struct { +// RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method. +type RegistriesClientGetOptions struct { // placeholder for future optional parameters } -// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List method. -type VirtualMachineSizesClientListOptions struct { +// RegistriesClientListBySubscriptionOptions contains the optional parameters for the RegistriesClient.NewListBySubscriptionPager +// method. +type RegistriesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// WorkspaceConnectionsClientCreateOptions contains the optional parameters for the WorkspaceConnectionsClient.Create method. -type WorkspaceConnectionsClientCreateOptions struct { +// RegistriesClientListOptions contains the optional parameters for the RegistriesClient.NewListPager method. +type RegistriesClientListOptions struct { // placeholder for future optional parameters } -// WorkspaceConnectionsClientDeleteOptions contains the optional parameters for the WorkspaceConnectionsClient.Delete method. -type WorkspaceConnectionsClientDeleteOptions struct { +// RegistriesClientUpdateOptions contains the optional parameters for the RegistriesClient.Update method. +type RegistriesClientUpdateOptions struct { // placeholder for future optional parameters } -// WorkspaceConnectionsClientGetOptions contains the optional parameters for the WorkspaceConnectionsClient.Get method. -type WorkspaceConnectionsClientGetOptions struct { +// 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 + + // 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 + + // 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 +} + +// 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 +} + +// 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 +} + +// 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 } @@ -745,6 +1521,12 @@ type WorkspaceConnectionsClientListOptions struct { Target *string } +// WorkspaceConnectionsClientListSecretsOptions contains the optional parameters for the WorkspaceConnectionsClient.ListSecrets +// method. +type WorkspaceConnectionsClientListSecretsOptions struct { + // placeholder for future optional parameters +} + // WorkspaceFeaturesClientListOptions contains the optional parameters for the WorkspaceFeaturesClient.NewListPager method. type WorkspaceFeaturesClientListOptions struct { // placeholder for future optional parameters @@ -759,6 +1541,9 @@ type WorkspacesClientBeginCreateOrUpdateOptions struct { // 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 } diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go b/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go index bac9444bd0dd..f32d824f42e8 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/polymorphic_helpers.go @@ -11,7 +11,7 @@ package armmachinelearning import "encoding/json" func unmarshalAssetReferenceBaseClassification(rawMsg json.RawMessage) (AssetReferenceBaseClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -36,7 +36,7 @@ func unmarshalAssetReferenceBaseClassification(rawMsg json.RawMessage) (AssetRef } func unmarshalAutoMLVerticalClassification(rawMsg json.RawMessage) (AutoMLVerticalClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -74,8 +74,29 @@ func unmarshalAutoMLVerticalClassification(rawMsg json.RawMessage) (AutoMLVertic return b, nil } +func unmarshalBatchDeploymentConfigurationClassification(rawMsg json.RawMessage) (BatchDeploymentConfigurationClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -114,7 +135,7 @@ func unmarshalComputeClassification(rawMsg json.RawMessage) (ComputeClassificati } func unmarshalComputeSecretsClassification(rawMsg json.RawMessage) (ComputeSecretsClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -138,8 +159,119 @@ func unmarshalComputeSecretsClassification(rawMsg json.RawMessage) (ComputeSecre return b, nil } +func unmarshalDataDriftMetricThresholdBaseClassification(rawMsg json.RawMessage) (DataDriftMetricThresholdBaseClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 unmarshalDataQualityMetricThresholdBaseClassification(rawMsg json.RawMessage) (DataQualityMetricThresholdBaseClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -164,7 +296,7 @@ func unmarshalDataVersionBasePropertiesClassification(rawMsg json.RawMessage) (D } func unmarshalDatastoreCredentialsClassification(rawMsg json.RawMessage) (DatastoreCredentialsClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -193,7 +325,7 @@ func unmarshalDatastoreCredentialsClassification(rawMsg json.RawMessage) (Datast } func unmarshalDatastorePropertiesClassification(rawMsg json.RawMessage) (DatastorePropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -210,6 +342,8 @@ func unmarshalDatastorePropertiesClassification(rawMsg json.RawMessage) (Datasto b = &AzureDataLakeGen2Datastore{} case string(DatastoreTypeAzureFile): b = &AzureFileDatastore{} + case string(DatastoreTypeOneLake): + b = &OneLakeDatastore{} default: b = &DatastoreProperties{} } @@ -220,7 +354,7 @@ func unmarshalDatastorePropertiesClassification(rawMsg json.RawMessage) (Datasto } func unmarshalDatastoreSecretsClassification(rawMsg json.RawMessage) (DatastoreSecretsClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -247,7 +381,7 @@ func unmarshalDatastoreSecretsClassification(rawMsg json.RawMessage) (DatastoreS } func unmarshalDistributionConfigurationClassification(rawMsg json.RawMessage) (DistributionConfigurationClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -272,7 +406,7 @@ func unmarshalDistributionConfigurationClassification(rawMsg json.RawMessage) (D } func unmarshalEarlyTerminationPolicyClassification(rawMsg json.RawMessage) (EarlyTerminationPolicyClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -297,7 +431,7 @@ func unmarshalEarlyTerminationPolicyClassification(rawMsg json.RawMessage) (Earl } func unmarshalForecastHorizonClassification(rawMsg json.RawMessage) (ForecastHorizonClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -320,7 +454,7 @@ func unmarshalForecastHorizonClassification(rawMsg json.RawMessage) (ForecastHor } func unmarshalIdentityConfigurationClassification(rawMsg json.RawMessage) (IdentityConfigurationClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -345,7 +479,7 @@ func unmarshalIdentityConfigurationClassification(rawMsg json.RawMessage) (Ident } func unmarshalJobBasePropertiesClassification(rawMsg json.RawMessage) (JobBasePropertiesClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -360,6 +494,8 @@ func unmarshalJobBasePropertiesClassification(rawMsg json.RawMessage) (JobBasePr b = &CommandJob{} case string(JobTypePipeline): b = &PipelineJob{} + case string(JobTypeSpark): + b = &SparkJob{} case string(JobTypeSweep): b = &SweepJob{} default: @@ -372,7 +508,7 @@ func unmarshalJobBasePropertiesClassification(rawMsg json.RawMessage) (JobBasePr } func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -405,7 +541,7 @@ func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassifica } func unmarshalJobInputClassificationMap(rawMsg json.RawMessage) (map[string]JobInputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages map[string]json.RawMessage @@ -424,7 +560,7 @@ func unmarshalJobInputClassificationMap(rawMsg json.RawMessage) (map[string]JobI } func unmarshalJobOutputClassification(rawMsg json.RawMessage) (JobOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -455,7 +591,7 @@ func unmarshalJobOutputClassification(rawMsg json.RawMessage) (JobOutputClassifi } func unmarshalJobOutputClassificationMap(rawMsg json.RawMessage) (map[string]JobOutputClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var rawMessages map[string]json.RawMessage @@ -473,8 +609,188 @@ func unmarshalJobOutputClassificationMap(rawMsg json.RawMessage) (map[string]Job return fMap, nil } +func unmarshalMonitorComputeConfigurationBaseClassification(rawMsg json.RawMessage) (MonitorComputeConfigurationBaseClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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(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 || string(rawMsg) == "null" { + 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 { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -496,8 +812,50 @@ func unmarshalNCrossValidationsClassification(rawMsg json.RawMessage) (NCrossVal return b, nil } +func unmarshalNodesClassification(rawMsg json.RawMessage) (NodesClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -520,7 +878,7 @@ func unmarshalOnlineDeploymentPropertiesClassification(rawMsg json.RawMessage) ( } func unmarshalOnlineScaleSettingsClassification(rawMsg json.RawMessage) (OnlineScaleSettingsClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -542,8 +900,115 @@ func unmarshalOnlineScaleSettingsClassification(rawMsg json.RawMessage) (OnlineS return b, nil } +func unmarshalOutboundRuleClassification(rawMsg json.RawMessage) (OutboundRuleClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 unmarshalPendingUploadCredentialDtoClassification(rawMsg json.RawMessage) (PendingUploadCredentialDtoClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -568,7 +1033,7 @@ func unmarshalSamplingAlgorithmClassification(rawMsg json.RawMessage) (SamplingA } func unmarshalScheduleActionBaseClassification(rawMsg json.RawMessage) (ScheduleActionBaseClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -579,6 +1044,8 @@ func unmarshalScheduleActionBaseClassification(rawMsg json.RawMessage) (Schedule switch m["actionType"] { case string(ScheduleActionTypeCreateJob): b = &JobScheduleAction{} + case string(ScheduleActionTypeCreateMonitor): + b = &CreateMonitorAction{} case string(ScheduleActionTypeInvokeBatchEndpoint): b = &EndpointScheduleAction{} default: @@ -591,7 +1058,7 @@ func unmarshalScheduleActionBaseClassification(rawMsg json.RawMessage) (Schedule } func unmarshalSeasonalityClassification(rawMsg json.RawMessage) (SeasonalityClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -613,8 +1080,31 @@ func unmarshalSeasonalityClassification(rawMsg json.RawMessage) (SeasonalityClas return b, nil } +func unmarshalSparkJobEntryClassification(rawMsg json.RawMessage) (SparkJobEntryClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -637,7 +1127,7 @@ func unmarshalTargetLagsClassification(rawMsg json.RawMessage) (TargetLagsClassi } func unmarshalTargetRollingWindowSizeClassification(rawMsg json.RawMessage) (TargetRollingWindowSizeClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -660,7 +1150,7 @@ func unmarshalTargetRollingWindowSizeClassification(rawMsg json.RawMessage) (Tar } func unmarshalTriggerBaseClassification(rawMsg json.RawMessage) (TriggerBaseClassification, error) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -682,8 +1172,48 @@ func unmarshalTriggerBaseClassification(rawMsg json.RawMessage) (TriggerBaseClas return b, nil } +func unmarshalWebhookClassification(rawMsg json.RawMessage) (WebhookClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + 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 || string(rawMsg) == "null" { + 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) { - if rawMsg == nil { + if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } var m map[string]any @@ -692,14 +1222,28 @@ func unmarshalWorkspaceConnectionPropertiesV2Classification(rawMsg json.RawMessa } var b WorkspaceConnectionPropertiesV2Classification switch m["authType"] { + case string(ConnectionAuthTypeAAD): + b = &AADAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeAccessKey): + b = &AccessKeyAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeAccountKey): + b = &AccountKeyAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeAPIKey): + b = &APIKeyAuthWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeCustomKeys): + b = &CustomKeysWorkspaceConnectionProperties{} case string(ConnectionAuthTypeManagedIdentity): b = &ManagedIdentityAuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypeNone): b = &NoneAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeOAuth2): + b = &OAuth2AuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypePAT): b = &PATAuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypeSAS): b = &SASAuthTypeWorkspaceConnectionProperties{} + case string(ConnectionAuthTypeServicePrincipal): + b = &ServicePrincipalAuthTypeWorkspaceConnectionProperties{} case string(ConnectionAuthTypeUsernamePassword): b = &UsernamePasswordAuthTypeWorkspaceConnectionProperties{} default: diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go index 312cc6057c45..e21536fcce2c 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Update the state of specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-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 @@ -99,7 +99,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -120,7 +120,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // Delete - Deletes the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-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 @@ -171,7 +171,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-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 @@ -232,7 +232,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all the private endpoint connections associated with the workspace. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager @@ -298,7 +298,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-07-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 da3f67cc6cad..28db96517518 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/privatelinkresources_client.go @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // List - Gets the private link resources that need to be created for a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-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 @@ -93,7 +93,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-07-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 8d13e85c3383..1ca757faf0fb 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/quotas_client.go @@ -45,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-07-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] { @@ -87,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +105,7 @@ 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-07-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. @@ -147,7 +147,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { 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..38e3d4ceebad --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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..efc68c216724 --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-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 *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..7d86a34dfebb --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + 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)) + } + reqQP.Set("api-version", "2024-07-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 *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..dbb0709c4b1b --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-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 *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..02a8b85bf2ca --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrycomponentversions_client.go @@ -0,0 +1,377 @@ +//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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + 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)) + } + reqQP.Set("api-version", "2024-07-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 *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..5dfce09e5708 --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + 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..b28330f88b8b --- /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. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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-07-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..28f78e46c5ab --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + 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.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2024-07-01-preview") + 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..e58e33b2191d --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + 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..da789f1a557f --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registryenvironmentversions_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" +) + +// 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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + 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)) + } + reqQP.Set("api-version", "2024-07-01-preview") + 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 *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..d27771d24cd3 --- /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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-01-preview") + 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..35dbeb8f53f2 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/registrymodelversions_client.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 + +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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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() + if options != nil && options.OrderBy != nil { + reqQP.Set("$orderBy", *options.OrderBy) + } + 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)) + } + reqQP.Set("api-version", "2024-07-01-preview") + 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.Properties != nil { + reqQP.Set("properties", *options.Properties) + } + if options != nil && options.Tags != nil { + reqQP.Set("tags", *options.Tags) + } + if options != nil && options.Version != nil { + reqQP.Set("version", *options.Version) + } + 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 +} diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go b/sdk/resourcemanager/machinelearning/armmachinelearning/responses.go similarity index 53% rename from sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go rename to sdk/resourcemanager/machinelearning/armmachinelearning/responses.go index 9f6ccfcb0222..8bc6bf26f54a 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/response_types.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/responses.go @@ -89,6 +89,11 @@ type CodeContainersClientListResponse struct { 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. @@ -112,6 +117,11 @@ type CodeVersionsClientListResponse struct { 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. @@ -158,6 +168,11 @@ type ComponentVersionsClientListResponse struct { 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. @@ -270,6 +285,11 @@ type DataVersionsClientListResponse struct { 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. @@ -355,6 +375,121 @@ type EnvironmentVersionsClientListResponse struct { 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 +} + // JobsClientCancelResponse contains the response from method JobsClient.BeginCancel. type JobsClientCancelResponse struct { // placeholder for future response values @@ -383,6 +518,58 @@ type JobsClientListResponse struct { JobBaseResourceArmPaginatedResult } +// 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 { + // Outbound Rule Basic Resource for the managed network of a machine learning workspace. + 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 { + // Outbound Rule Basic Resource for the managed network of a machine learning workspace. + 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 +} + +// MarketplaceSubscriptionsClientCreateOrUpdateResponse contains the response from method MarketplaceSubscriptionsClient.BeginCreateOrUpdate. +type MarketplaceSubscriptionsClientCreateOrUpdateResponse struct { + // Azure Resource Manager resource envelope. + MarketplaceSubscription +} + +// MarketplaceSubscriptionsClientDeleteResponse contains the response from method MarketplaceSubscriptionsClient.BeginDelete. +type MarketplaceSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// MarketplaceSubscriptionsClientGetResponse contains the response from method MarketplaceSubscriptionsClient.Get. +type MarketplaceSubscriptionsClientGetResponse struct { + // Azure Resource Manager resource envelope. + MarketplaceSubscription +} + +// MarketplaceSubscriptionsClientListResponse contains the response from method MarketplaceSubscriptionsClient.NewListPager. +type MarketplaceSubscriptionsClientListResponse struct { + // A paginated list of MarketplaceSubscription entities. + MarketplaceSubscriptionResourceArmPaginatedResult +} + // ModelContainersClientCreateOrUpdateResponse contains the response from method ModelContainersClient.CreateOrUpdate. type ModelContainersClientCreateOrUpdateResponse struct { // Azure Resource Manager resource envelope. @@ -429,6 +616,11 @@ type ModelVersionsClientListResponse struct { ModelVersionResourceArmPaginatedResult } +// 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 @@ -511,8 +703,8 @@ type OnlineEndpointsClientUpdateResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // An array of operations supported by the resource provider. - 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. @@ -556,6 +748,294 @@ type QuotasClientUpdateResponse struct { 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 +} + // SchedulesClientCreateOrUpdateResponse contains the response from method SchedulesClient.BeginCreateOrUpdate. type SchedulesClientCreateOrUpdateResponse struct { // Azure Resource Manager resource envelope. @@ -579,6 +1059,44 @@ type SchedulesClientListResponse struct { 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 +} + +// 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. @@ -611,6 +1129,11 @@ type WorkspaceConnectionsClientListResponse struct { WorkspaceConnectionPropertiesV2BasicResourceArmPaginatedResult } +// WorkspaceConnectionsClientListSecretsResponse contains the response from method WorkspaceConnectionsClient.ListSecrets. +type WorkspaceConnectionsClientListSecretsResponse struct { + WorkspaceConnectionPropertiesV2BasicResource +} + // WorkspaceFeaturesClientListResponse contains the response from method WorkspaceFeaturesClient.NewListPager. type WorkspaceFeaturesClientListResponse struct { // The List Aml user feature operation response. diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go index ae5f7ae1e9c5..625bdb807516 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/schedules_client.go @@ -46,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-07-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,7 +60,8 @@ func (client *SchedulesClient) BeginCreateOrUpdate(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SchedulesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -73,7 +74,7 @@ func (client *SchedulesClient) BeginCreateOrUpdate(ctx context.Context, resource // 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-07-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" @@ -119,7 +120,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -131,7 +132,7 @@ func (client *SchedulesClient) createOrUpdateCreateRequest(ctx context.Context, // 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Schedule name. @@ -143,7 +144,8 @@ func (client *SchedulesClient) BeginDelete(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SchedulesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -156,7 +158,7 @@ func (client *SchedulesClient) BeginDelete(ctx context.Context, resourceGroupNam // 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-07-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" @@ -202,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +213,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - name - Schedule name. @@ -262,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,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-07-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. @@ -326,10 +328,10 @@ func (client *SchedulesClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.ListViewType != nil { reqQP.Set("listViewType", string(*options.ListViewType)) } 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..d2b9e790c890 --- /dev/null +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/serverlessendpoints_client.go @@ -0,0 +1,590 @@ +//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-07-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-07-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-07-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-07-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-07-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.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-07-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-07-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-07-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 +} + +// NewListPager - List Serverless Endpoints. +// +// Generated from API version 2024-07-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() + if options != nil && options.Skip != nil { + reqQP.Set("$skip", *options.Skip) + } + reqQP.Set("api-version", "2024-07-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 *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-07-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-07-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-07-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-07-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-07-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-07-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-07-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-07-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 f74d9b2ed5e4..12a8cd3fc752 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/time_rfc3339.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // 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+)*"*$`) +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 + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go b/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go index 818d7837e5c7..abe274807926 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/usages_client.go @@ -45,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-07-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] { @@ -87,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-07-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 50b9a11f2782..f34b250d0d22 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/virtualmachinesizes_client.go @@ -46,7 +46,7 @@ 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-07-01-preview // - location - The location upon which virtual-machine-sizes is queried. // - options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.List // method. @@ -88,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-07-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 9279dd18a675..3357af99984b 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaceconnections_client.go @@ -46,7 +46,7 @@ func NewWorkspaceConnectionsClient(subscriptionID string, credential azcore.Toke // Create - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - connectionName - Friendly name of the workspace connection @@ -99,7 +99,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *WorkspaceConnectionsClient) createHandleResponse(resp *http.Respon // Delete - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - connectionName - Friendly name of the workspace connection @@ -171,7 +171,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *WorkspaceConnectionsClient) deleteCreateRequest(ctx context.Contex // Get - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - connectionName - Friendly name of the workspace connection @@ -232,7 +232,7 @@ func (client *WorkspaceConnectionsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2024-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,13 +294,13 @@ func (client *WorkspaceConnectionsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - if options != nil && options.Target != nil { - reqQP.Set("target", *options.Target) - } + reqQP.Set("api-version", "2024-07-01-preview") if options != nil && options.Category != nil { reqQP.Set("category", *options.Category) } - reqQP.Set("api-version", "2022-10-01") + if options != nil && options.Target != nil { + reqQP.Set("target", *options.Target) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,3 +314,73 @@ 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-07-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - Name of Azure Machine Learning workspace. +// - 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-07-01-preview") + 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 +} 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 9aa318676968..35bc003925ae 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/workspacefeatures_client.go @@ -45,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-07-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 @@ -93,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-07-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 759829135d55..ac2995af95ea 100644 --- a/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client.go +++ b/sdk/resourcemanager/machinelearning/armmachinelearning/workspaces_client.go @@ -17,6 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -46,7 +47,7 @@ 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-07-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. @@ -72,7 +73,7 @@ func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // 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 +// Generated from API version 2024-07-01-preview func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "WorkspacesClient.BeginCreateOrUpdate" @@ -114,7 +115,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +127,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, // 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. @@ -150,7 +151,7 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa // 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-07-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" @@ -192,7 +193,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-07-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 @@ -201,7 +205,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientBeginDiagnoseOptions contains the optional parameters for the WorkspacesClient.BeginDiagnose @@ -227,7 +231,7 @@ func (client *WorkspacesClient) BeginDiagnose(ctx context.Context, resourceGroup // 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-07-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" @@ -269,7 +273,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -284,7 +288,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -330,7 +334,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +351,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-07-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. @@ -390,10 +394,10 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,7 +414,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-07-01-preview // - options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -448,10 +452,10 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") if options != nil && options.Skip != nil { reqQP.Set("$skip", *options.Skip) } + reqQP.Set("api-version", "2024-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -470,7 +474,7 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp // 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientListKeysOptions contains the optional parameters for the WorkspacesClient.ListKeys method. @@ -516,7 +520,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -534,7 +538,7 @@ func (client *WorkspacesClient) listKeysHandleResponse(resp *http.Response) (Wor // ListNotebookAccessToken - return notebook access token and refresh token // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientListNotebookAccessTokenOptions contains the optional parameters for the WorkspacesClient.ListNotebookAccessToken @@ -581,7 +585,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +603,7 @@ func (client *WorkspacesClient) listNotebookAccessTokenHandleResponse(resp *http // ListNotebookKeys - List keys of a notebook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientListNotebookKeysOptions contains the optional parameters for the WorkspacesClient.ListNotebookKeys @@ -646,7 +650,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -665,7 +669,7 @@ 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the WorkspacesClient.ListOutboundNetworkDependenciesEndpoints @@ -712,7 +716,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -730,7 +734,7 @@ func (client *WorkspacesClient) listOutboundNetworkDependenciesEndpointsHandleRe // ListStorageAccountKeys - List storage account keys of a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientListStorageAccountKeysOptions contains the optional parameters for the WorkspacesClient.ListStorageAccountKeys @@ -777,7 +781,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -795,7 +799,7 @@ func (client *WorkspacesClient) listStorageAccountKeysHandleResponse(resp *http. // BeginPrepareNotebook - Prepare a notebook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientBeginPrepareNotebookOptions contains the optional parameters for the WorkspacesClient.BeginPrepareNotebook @@ -821,7 +825,7 @@ func (client *WorkspacesClient) BeginPrepareNotebook(ctx context.Context, resour // PrepareNotebook - Prepare a notebook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2024-07-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" @@ -863,7 +867,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -873,7 +877,7 @@ func (client *WorkspacesClient) prepareNotebookCreateRequest(ctx context.Context // 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-07-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - Name of Azure Machine Learning workspace. // - options - WorkspacesClientBeginResyncKeysOptions contains the optional parameters for the WorkspacesClient.BeginResyncKeys @@ -899,7 +903,7 @@ func (client *WorkspacesClient) BeginResyncKeys(ctx context.Context, resourceGro // 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-07-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" @@ -941,7 +945,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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -950,7 +954,7 @@ 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-07-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. @@ -975,7 +979,7 @@ func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupNa // 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 +// Generated from API version 2024-07-01-preview func (client *WorkspacesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters, options *WorkspacesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "WorkspacesClient.BeginUpdate" @@ -1017,7 +1021,7 @@ 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-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != 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), - // }}, - // }}, - // }, - // }}, - // } -}